我使用我的類的屬性相關的參考作爲存儲「BOOL」(又名「符號字符」),以「身份證」的隱式轉換,objc_setAssociatedObject
頭文件包含:
@interface UIImageView (Spinning)
@property (nonatomic, assign) BOOL animating;
@end
實現
- (void)setAnimating:(BOOL)value {
objc_setAssociatedObject(self, animatingKey, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
不過,我收到預警線之上
Implicit conversion of 'BOOL' (aka 'signed char') to 'id' is disallowed with ARC
,如果你知道我做錯了,請幫忙如何避免這個問題