Error in ARC forbids explicit message send of release in OC, ocforbids

Source: Internet
Author: User

Error in ARC forbids explicit message send of release in OC, ocforbids
ARC forbids explicit message send of 'release'

Obviously, it is an issue of ARC. Cause of error: when creating the project, I clicked the "Use Automatic Reference Counting" option, but called the release method of the object.

What is ARC?
ARC is a new feature launched by iOS 5, called Automatic ReferenceCounting ). Simply put, retain/release is automatically added to the Code. The Code that was manually added to handle the reference count of memory management can be automatically completed by the compiler. This mechanism starts to be imported in iOS 5/Mac OS X 10.7 and can be used in Xcode4.2. A simple understanding of ARC means that the compiler (LLVM3.0) will automatically generate the reference count of the instance to manage part of the code During code compilation through the specified syntax. One thing is that ARC is not a GC, but a code static analysis (StaticAnalyzer) tool.


Solution: select a project, double-click the project name in the middle, and enter build setting


Change the Objective-C Automatic Reference Counting in the middle to no.







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.