对于XCode 5.1,会出现一个新的警告.这让我明白我做错了什么.
其 idea 是要有一个对象(一个模型)及其从原始类继承的可变版本.所以我们的 idea 是开一个readonly
到readwrite
的房产
@interface Car : NSObject
@property (strong, readonly) NSString *name;
@end
@interface MutableCar : Car
@property (strong, readwrite) NSString *name;
@end
这些需要放在不同的文件中(比如两个普通类).
它给出了这样的警告:
Auto property synthesis will not synthesize property 'name' because it is 'readwrite' but it will be synthesized 'readonly' via another property
所以我想知道,如果可能的话,做类似的事情的正确解决方案是什么.如果需要编写访问器,避免使用自动合成等,请精确,并用文档或任何东西支持您的答案.