ARC使用
a.ARC中不要retain,release,autorelease,dealloc method.创建自动释放池@ autoreleasepool{}。其本质为:本该你去release某个对象的代码,交由编译器去写。
b.__weak __strong指明重写修饰对象的getter和setter方法.
c.ARC对Core Foundation对象不做处理,想将其与ARC结合,用CFBridgingRetain、CFBridgingRelease、__bridge(transfers a pointer between Objective-C and Core Foundation with no transfer of ownership.)
d.指定对某个文件ARC:-fobjc-arc.指定某个文件不采用ARC:-fno-objc-arc.在TARGET->Build Phases->compile source处进行修改。
e.ARC中想告诉编译器可以释放此对象,代码添加"object=nil".在didreceivememorywarning中可"object = nil;"
转载请标明出处