The understanding that the release "cannot" be used in Xcode4.2

Source: Internet
Author: User
Tags manual

Automatic Reference Counting (ARC), an automatic reference count, is a compile-level feature of the development of a cocoa program for automatic memory management.

1: In Xcode 4.2, use a template to create a new project that will use the "Default" option for Arc features

2: For the project has been established can be selected, building settings, and then find objective C Automatic Reference counting (Cannot find, can search), set to No on the line.

Basic---of----arc theory

Arc works by automatically adding the code for the memory operation (Retain,release or autorelease) to the desired location when you compile the program. That is, the same memory management mechanism as the manual Reference counting (manual reference count) is used on the ground floor, but it simplifies programming because Xcode automatically helps you add code for memory operations at compile time.

ARC is enabled, and-fobjc-arc is required in the compilation options, but this is done by Xcode when creating the project template.

ARC is not supported in previous versions of XCode 4.2.

Also required for the operating system: Mac OS X v10.6 or v10.7 (64-bit applications), iOS4 or iOS5. Note: Mac OS X v10.6 and iOS4 do not support weak references (weak references, which later explain what weak references).

Xcode 4.2 provides a tool called "Convert to objective-c Automatic Reference counting", which, under Edit->convert menu, can help you automatically use manual The old code for Reference counting is converted to new code that uses arc (for example, removing calls to retain and release).

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.