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.