BUG-Auto property synthesis will not synthesize property 'description' because it is 'readwrite'
2016-07-25 16:41
531 查看
今天遇见实现一个网络请求接口的遇到一个问题:
@property (nonatomic,
strong)NSString * description;
//O 描述:最长256字节
报错:
Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another property
看了一下才知道,是接口那边定义的字段有问题,做开发的都知道,在代码中有许多特殊字段是不能随便使用的,系统会给你warning提示,
恰好这个descripton就跟系统字典重合了,so 百度了一下,
原因:
是因为 compiler 读取 sub-class 時,会发现 description 明明应该是個 readonly property(super-class 讲的),但你却要将它设为 readwriteproperty,所以 compiler 不知道该怎么 auto synthesis。
解决方法:
#import "AddPrivacyRecord.h"
@implementation AddPrivacyRecord
@dynamic description;
.m文件中 @dynamic一下就OK了哦。
参考的blog:http://blog.csdn.net/l863784757/article/details/46374939
@property (nonatomic,
strong)NSString * description;
//O 描述:最长256字节
报错:
Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another property
看了一下才知道,是接口那边定义的字段有问题,做开发的都知道,在代码中有许多特殊字段是不能随便使用的,系统会给你warning提示,
恰好这个descripton就跟系统字典重合了,so 百度了一下,
原因:
是因为 compiler 读取 sub-class 時,会发现 description 明明应该是個 readonly property(super-class 讲的),但你却要将它设为 readwriteproperty,所以 compiler 不知道该怎么 auto synthesis。
解决方法:
#import "AddPrivacyRecord.h"
@implementation AddPrivacyRecord
@dynamic description;
.m文件中 @dynamic一下就OK了哦。
参考的blog:http://blog.csdn.net/l863784757/article/details/46374939
相关文章推荐
- openpyxl
- shell/命令行下的光标移动等操作技巧
- linux 中的MYSQL命令汇总 适合学习linux下配置mysql的朋友
- Emgu在引用openCV时提示:无法加载 DLL“opencv_core2410”: 找不到指定的模块。
- Apache实现Tomcat集群
- 【CentOS】比较有用的find系列工具
- auto_ptr、shared_ptr、weak_ptr、scoped_ptr用法小结
- tomcat7 生产环境优化(有些JVMtomcat5 6上的参数被取消了)
- 全球50大在线学习网站
- 关于linux网络基础记录
- popuWindow和软键盘共存
- Linux定时执行任务
- Linux -trap
- Mac 安装运行 Docker for Mac
- Linux内核之进程调度
- 使用 CAS 在 Tomcat 中实现单点登录
- linux tc 笔记整理(traffic control)
- opencv在MAC下的安装
- 使用OpenTSDB遇到的问题
- delete drop truncate