ARC 使用規則

    代碼中不能使用retain, release, retain, autorelease
    不重載dealloc(若是是釋放對象內存之外的處理,是能夠重載該函數的,可是不能調用[super dealloc])
    不能使用NSAllocateObject, NSDeallocateObject
    不能在C結構體中使用對象指針
    id與void *間的若是cast時須要用特定的方法(__bridge關鍵字)
    不能使用NSAutoReleasePool、而須要@autoreleasepool塊
    不能使用「new」開始的屬性名稱 (若是使用會有下面的編譯錯誤」Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects」)
相關文章
相關標籤/搜索