Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it
来源:互联网 发布:python vim 编辑:程序博客网 时间:2024/05/23 19:14
解析后台返回的json数据时,推荐使用MJExtension ,使用起来很方便
github:https://github.com/CoderMJLee/MJExtension
在AModel.h中
@property(nonatomic,strong)NSString *description;
出现提示warning:Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another property
原因是因为 compiler 读取 sub-class 時,会发现 description 明明应该是個 readonly property(super-class 讲的),但你却要将它设为 readwriteproperty,所以 compiler 不知道该怎么 auto synthesis。
解决办法:
AModel.m
@implementation AModel
@dynamic description;
@end
但是刚从后台拿数据时,用MJExtension.h解析数据时,还是拿不到数据。
后台返回的字典里的字段是description,但是可以在model里用Description来表示,大写的D。
在AModel.m里实现
+(NSDictionary *)replacedKeyFromPropertyName{
return@{@"Description":@"description"};
}
核心代码:
AModel *subM = [AModelobjectWithKeyValues:dic];- Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it
- Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it
- Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it
- BUG-Auto property synthesis will not synthesize property 'description' because it is 'readwrite'
- Auto property synthesis will not synthesize property …because it is ‘readwrite’ but it will be synth
- [iOS开发]错误总结一:Auto property synthesis will not synthesize property 'imageView' because it is 'readwri
- Auto property synthesis will not synthesize property 'delegate'; it will be implemented by its super
- Auto property synthesis will not synthesize property ‘delegate’;it will be implemented by its superc
- Auto property synthesis will not synthesize property ‘delegate’;it will be implemented by its superc
- Auto property synthesis will not synthesize property......
- Auto property synthesis will not synthesize property '***'
- auto property synthesis will not synthesize proterty ;it will be implementedby its superclass, use @
- 报错原因:Auto property synthesis will not synthesize property 'title'; it will be implemented by its sup
- AFNetwork错误:Auto property synthesis will not synthesize property
- Xcode: Auto property synthesis will not synthesize property 解决
- Auto property synthesis will not synthesizeproterty;it will be implemented by its superclass, use@dy
- Xcode升级了6.3 出现的警告:Auto property synthesis will not synthesize property
- OC 中 覆盖属性会有提示Auto property synthesis will not synthesize property 'delegate'
- 求点双连通分量
- 提高篇:Linux(附答案)
- 初创企业都用什么开发技术?
- sqlite中的virtual表之空间索引
- tail和ls的使用, bash-completion的安装和使用
- Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it
- dede搜索页面的问题{dede:hotwords /}参数说明:num=’5′ 关键词数目 subday=’100′ 天数 maxlength=’32′ 关键词最大长度 在很多时候,搜索
- LevelDB 存储编码
- unity中手指选中物体拖动旋转
- Windows中句柄和ID的区别
- WeOnlyDo.Server服务器介绍
- javascript/JS限制用户名只能输入 汉字字母和数字下划线
- 页面Sql语句 查询根据判断值是否存在拼接查询条件
- Crontab 定时任务