Complete arc Guide
The most significant change in iOS 5 is the addition of automatic
Reference counting (automatic reference count ). ARC is the new llvm
3.0 compiler features completely eliminate the hassle of manual memory management. Using Arc in your project is very simple. All programming is the same as before, except that you no longer call retain,
Release, autorelease. After arc is enabled, the compiler automatically inserts the appropriate retain, release, and autorelease statements in the appropriate places. You no longer need to worry about memory management, because the compiler handles everything for you. Note that arc is a compiler feature, not IOS runtime feature (except weak pointer system), and it is not a garbage collector in other languages. Therefore, the performance of arc and manual memory management is the same, and sometimes it can be faster, because the compiler can also perform some optimizations.
There are too many details, so we will not list them. Here we will list a directory:
Complete arc guide ..................................... ........................................ ................................... 3
The pointer keeps the object's life ................................... ........................................ .................. 3
Automatic migration of Arc in xcode ................................... ........................................ .............. 9
Xcode's automatic migration tool ................................... ........................................ ........ 9
Other problems after conversion ................................... ........................................ ............. 14
Disable the arc of some files ................................... ........................................ .........
14
FAQs about automatic arc migration .................................. ........................................ .. 15
Property ...................................... ........................................ ......................... 17
Iboutlet ....................................... ........................................ ........................... 18
Readonly property ...................................... ........................................ ............ 19
Autorelease, release, and retain call .................................. ................................... 19
Dealloc method ...................................... ........................................ ............................ 20
Autoreleasepool ....................................... ........................................ ..................... 20
Toll-free bridging .................................... ........................................ ...................... 21
Delegate and weak property .................................... ........................................ .... 26
Unsafe_unretained ....................................... ........................................ ................. 27
In IOS 4, use arc ................................... ........................................ ....................... 27
Arc advanced guide ..................................... ........................................ ................................. 28
Blocks and Arc ..................................... ........................................ ........................... 28
Singleton and Arc ..................................... ........................................ ...................... 34
Autorelease and autoreleasepool ..................................... ..................................... 40
Cocos2d and box2d ..................................... ........................................ ................. 45
Static library .................................... ........................................ .................. 48
At last ?...................................... ........................................ ..................................... 49
Please refer to the following link for more information ...................................... ........................................ ................................. 49
Download: http://www.cocoachina.com/bbs/read.php? Tid = 92507 & page = 1