Complete iOS 5 arc Guide

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.