How to give an external property to UIButton-Collection of common programming errors
You can either create a UIButton
subclass, or use Obj-C runtime associations like this
#import
static char kMyExtendedPropKey;
objc_setAssociatedObject(myButton,
&kMyExtendedPropKey,
yourObjectToAssociate,
OBJC_ASSOCIATION_RETAIN);
Note that associations can be used in conjunction with categories to add new properties to existing classes! But use with caution, subclassing is the preferred way.