1. 程式人生 > >常用宏定義 - 內存相關

常用宏定義 - 內存相關

bject 定義 feature end without mrc objective nil define


1、處理ARC和MRC,對象釋放

/** 使用ARC和不使用ARC */
#if __has_feature(objc_arc)
    //compiling with ARC
#else
    // compiling without ARC
#endif

/** 釋放一個對象 */
#define SAFE_DELETE(P) if(P) { [P release], P = nil; }

常用宏定義 - 內存相關