I am trying to create "fake" instance variables in categories by using objc_setAssociatedObject
as described in this post.
However, I get the following error using ARC in iOS 6.1: Use of undeclared identifier 'OBJC_ASSOCIATION_RETAIN
for the following code snippet:
- (void)setStyleName:(NSString *)styleName
{
objc_setAssociatedObject(self, kDHStyleKey, styleName,
OBJC_ASSOCIATION_RETAIN);
}
Has anything changed for iOS 6.1?
What did I miss?
It seems that I did not import: #import <objc/runtime.h>