Tag: 遗传

inheritance属性,setter在从readonly读取inheritance的属性时不合成

当我使用一个属性时,我发现了一个奇怪的行为,它被inheritance为readonly,并且在inheritance的类中被重新声明为readwrite 在啊 @interface A : NSObject @property (nonatomic, strong, readonly) NSObject * someProperty; @end 在Bh @interface B : A // no matter if here // @property (nonatomic, strong, readwrite) NSObject * someProperty; – (void)foo; @end 在Bm @interface B() // no matter if here @property (nonatomic, strong, readwrite) NSObject * someProperty; @end @implementation B – (void)foo […]