延续类中的 get 属性与主类不匹配



在myClass.h中,我做:

typedef enum {
    SignUpLabel,
    SignUpButton,
    LogInFieldsTwitterButton,
    LogInFieldsFacebookButton,
    LogInWithFaceBookTiwtterLabel,
} logInFields;
@property (nonatomic, readonly, assign) logInFields fields;
@end

我希望logInField对公共只读,但它可以私下读取/写入。因此,我这样做:

@interface myClass ()
@property (readwrite, assign ) logInFields fields;
@end

但是,我收到警告:

Property attribute in continuation class does not match the primary class

有人可以告诉我我在这里缺少什么以及如何使编译器静音吗?

您是否尝试在 .m 中添加"非原子"?

最新更新