Skip to content

Instantly share code, notes, and snippets.

@yfrancis
Created March 15, 2013 19:38
Show Gist options
  • Save yfrancis/5172526 to your computer and use it in GitHub Desktop.
Save yfrancis/5172526 to your computer and use it in GitHub Desktop.
#define ASSOCIATED_PROPERTY(Type, getter, setter, key, association) \
static char key;\
%new -(void)setter:(Type)val{objc_setAssociatedObject(self, &key, val, association);}\
%new -(Type)getter{return objc_getAssociatedObject(self, &key);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment