Skip to content

Instantly share code, notes, and snippets.

@sebreh
Last active December 11, 2015 21:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebreh/4664197 to your computer and use it in GitHub Desktop.
Save sebreh/4664197 to your computer and use it in GitHub Desktop.
Shorthand macros for creating weak references.
#define SR_WEAK(obj) __typeof__(obj) __weak
#define SR_WEAK_SELF SR_WEAK(self)
// Usage:
// SR_WEAK_SELF weakSelf = self;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment