Import this:
#import <objc/runtime.h>
Then use this line to attach the object:
objc_setAssociatedObject(yourObject, (const void*)0x314, objectToAttach, OBJC_ASSOCIATION_RETAIN);
Use this line later to get the object back:
id objectThatWasAttached = objc_getAssociatedObject(yourObject, (const void*)0x314);
Trust me, you'll find a use for it.
No comments:
Post a Comment