Skip to content

Instantly share code, notes, and snippets.

@AtomicCat
Created May 10, 2011 19:08
Show Gist options
  • Select an option

  • Save AtomicCat/965158 to your computer and use it in GitHub Desktop.

Select an option

Save AtomicCat/965158 to your computer and use it in GitHub Desktop.
static char *kMyAssociationKey = nil;
- (void)setContext:(id)context
{
objc_setAssociatedObject(self, &kMyAssociationKey, context, OBJC_ASSOCIATION_ASSIGN);
}
- (id)context
{
return objc_getAssociatedObject(self, &kMyAssociationKey);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment