//ARC Helper #ifndef WS_SUPPORT_ARC #define WS_SUPPORT_ARC #if __has_feature(objc_arc_weak) //objc_arc_weak #define WS_WEAK weak #define __WS_WEAK __weak #define WS_STRONG strong #define WS_AUTORELEASE self #define WS_RELEASE self #define WS_RETAIN self #define WS_CFTYPECAST(exp) (__bridge exp) #define WS_TYPECAST(exp) (__bridge_transfer exp) #define WS_CFRELEASE(exp) CFRelease(exp) #define WS_DEALLOC self #elif __has_feature(objc_arc) //objc_arc #define WS_WEAK unsafe_unretained #define __WS_WEAK __unsafe_unretained #define WS_STRONG strong #define WS_AUTORELEASE self #define WS_RELEASE self #define WS_RETAIN self #define WS_CFTYPECAST(exp) (__bridge exp) #define WS_TYPECAST(exp) (__bridge_transfer exp) #define WS_CFRELEASE(exp) CFRelease(exp) #define WS_DEALLOC self #else //none #define WS_WEAK assign #define __WS_WEAK #define WS_STRONG retain #define WS_AUTORELEASE autorelease #define WS_RELEASE release #define WS_RETAIN retain #define WS_CFTYPECAST(exp) (exp) #define WS_TYPECAST(exp) (exp) #define WS_CFRELEASE(exp) CFRelease(exp) #define WS_DEALLOC dealloc
#define __bridge #endif//__has_feature #endif//WS_SUPPORT_ARC //ARC Helper
转载于:https://www.cnblogs.com/kiss007/archive/2012/09/26/2704019.html