Skip to content

Instantly share code, notes, and snippets.

@OliverLetterer
Created September 23, 2012 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverLetterer/3772914 to your computer and use it in GitHub Desktop.
Save OliverLetterer/3772914 to your computer and use it in GitHub Desktop.
declaration of weak and strong self instances.
#ifndef __weakSelf
#define __weakSelf __weak typeof(self) weakSelf = self
#endif
#ifndef __strongSelf
#define __strongSelf __strong typeof(weakSelf) strongSelf = weakSelf
#endif
#ifndef __weakObject
#define __weakObject(object) typeof(object) weak_##object = object
#endif
#ifndef __strongObject
#define __strongObject(object) __strong typeof(weak_##object) strong_##object = weak_##object
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment