arc enforces new rules


Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C objects. Rather than having to think about about retain and release operations, ARC allows you to concentrate on the interesting code, the object graphs, and the relationships between objects in your application.


  • 不用再去调用dealloc,retain,release,retainCount或者autorelease这些方法了。也就是说我们在代码中不需要这些了,是不是轻松很多啊。省去了代码中超级多的release。
  • 不能使用NSAllocateObject和NSDeallocatedObject。
  • 不能在C structires中使用对象指针。
  • There is no casual casting between id and void *.
  • 不能使用NSAutoreleasePool,取而代之的是@autoreleasepool,你可以在你生成代码的main.m文件中看到这一变化。
  • 不能使用memory zones,也就是说不在需要NSZone了。
  • 还有一点就是在属性声明的时候,属性的名字不能以new开头。 (如果使用了,那么产生的错误,可以参考 Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects).
    以上内容取自ARC Enforces New Rules