随着XCode 5.1,出现一个新的警告。这让我明白了-显然 -我做错了什么。自动属性综合(@属性)和继承
想法是有一个对象(模型),它是从原始类继承的可变版本。这样的想法是要打开的是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
所以我想知道什么是做类似的东西正确的解决方案,如果它甚至有可能。如果需要编写访问器并避免使用自动合成等,请务必精确并通过文档或其他方式支持您的答案。
我无法用给定的代码重现警告。 – Tim
我做了,是的,你需要把它放在单独的文件中(创建两个类) – AncAinu
任何我可以通过或忽略的标志摆脱这一点? –