I'm trying to add "properties" to categories using associate objects API.
objc_setAssociatedObject(self, &kIsAnimatingAssocObjKey, animating,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
Xcode complains:
Implicit declaration of function 'objc_setAssociatedObject' is invalid in C99
and
Use of undeclared identifier 'OBJC_ASSOCIATION_RETAIN_NONATOMIC'
Xcode 4.5.2, iOS SDK 6 with deployment target 6. It does not work.
None of the articles on obj_assoc mention that I must import anything special.
Simply import the runtime header:
#import <objc/runtime.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With