// Declaration
@interface MyObject (ExtendedProperties)
@property (nonatomic, strong, readwrite) id myCustomProperty;
@end
// Implementation
static void * MyObjectMyCustomPorpertyKey = (void *)@"MyObjectMyCustomPorpertyKey";
@implementation MyObject (ExtendedProperties)
- (id)myCustomProperty
{
return objc_getAssociatedObject(self, MyObjectMyCustomPorpertyKey);
}
- (void)setMyCustomProperty:(id)myCustomProperty
{
objc_setAssociatedObject(self, MyObjectMyCustomPorpertyKey, myCustomProperty, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end