Skip to content

Instantly share code, notes, and snippets.

@justin
Created April 4, 2012 05:37
Show Gist options
  • Save justin/2298071 to your computer and use it in GitHub Desktop.
Save justin/2298071 to your computer and use it in GitHub Desktop.
ARC Helper Macros
#ifndef SG_RETAIN
#if __has_feature(objc_arc)
#define SG_RETAIN(x) x
#define SG_RELEASE(x)
#define SG_AUTORELEASE(x) x
#define SG_SUPER_DEALLOC
#else
#define __SG_WEAK
#define SG_WEAK assign
#define SG_RETAIN(x) [x retain]
#define SG_RELEASE(x) [x release]
#define SG_AUTORELEASE(x) [x autorelease]
#define SG_SUPER_DEALLOC [super dealloc]
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment