在 Xcode 8.3.2 和 Objective-C 中,如果你在一个类别中有一个类属性,它有时会导致一个警告。我怎样才能摆脱它?
警告是
ld: warning: Some object files have incompatible Objective-C category
definitions. Some category metadata may be lost. All files containing
Objective-C categories should be built using the same compiler.
类属性看起来像这样:
@interface NSObject (Thingie)
@property (class, readonly, strong) id thingie;
@end
以及实施
@implementation NSObject (Thingie)
+ (id)thingie {
return nil; // doesn't matter for this
}
@end