/
KVC访问非属性变量
KVC访问非属性变量
kvcs是否可以访问非属性变量,答案是可以的.
@interface ModelDemo : NSObject { //@private NSString *demoString; } @end
ModelDemo *demo = [[ModelDemo alloc] init]; [demo setValue:@"Demo" forKey:@"demoString"]; NSLog(@"%@",[demo valueForKey:@"demoString"]);
不会出现crash.即使加上@private.同样可以访问.
, multiple selections available,
Related content
iOS生产力之小工具合集
iOS生产力之小工具合集
More like this
谈谈iOS Animation
谈谈iOS Animation
More like this
NSLayoutConstraint-代码实现自动布局的函数用法说明
NSLayoutConstraint-代码实现自动布局的函数用法说明
More like this
PCH was compiled with module cache
PCH was compiled with module cache
More like this
MRC Project to ARC
MRC Project to ARC
More like this