Skip to content

Instantly share code, notes, and snippets.

@odrobnik
Created June 3, 2013 09:54
Show Gist options
  • Save odrobnik/5697208 to your computer and use it in GitHub Desktop.
Save odrobnik/5697208 to your computer and use it in GitHub Desktop.
using weak where possible ...
#import <Availability.h>
#if __has_feature(objc_arc_weak)
#define DT_WEAK_IVAR_IF_SUPPORTED __weak
#define DT_WEAK_PROPERTY_IF_SUPPORTED weak
#elif __has_feature(objc_arc)
#define DT_WEAK_IVAR_IF_SUPPORTED __unsafe_unretained
#define DT_WEAK_PROPERTY_IF_SUPPORTED assign
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment