当子类的属性定义和父类的属性定义发生冲突时,会有一个warning提示
Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another proterty
Paste_Image.png
解决方案一:修改子类属性名,比如unusualDescription。
而有时候我们定义Model常常是要解析服务器json数据用的,要求属性字段和服务器返回的字段保持一致,这种情况一般采用方案二
解决方案二:在子类中显式的声明一个
@synthesize description = _description
;
Paste_Image.png