Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Xcode4.2 Automatic Reference Counting

Today, I have update my xCode to 4.2 version, And I want to disable the ARC, I also search with the google. but can't fix my problem. According the search results, In the target setting, I can't find the 'Objective-C Automatic reference counting' item, So have no chance to set it to NO. I find the item one by one, and also use the search field.

And one know the newest Xcode4.2 ,how to disable the ARC for the project, not for the specific file.

Thanks very much.

like image 956
user501836 Avatar asked Oct 20 '11 13:10

user501836


People also ask

Why is automatic reference counting a type of garbage collection mechanism?

Automatic Reference counting or ARC, is a form of garbage collection in which objects are deallocated once there are no more references to them, i.e. no other variable refers to the object in particular.

How do I disable ARC in Xcode?

You can disable ARC for a specific class using the -fno-objc-arc compiler flag for that class. In Xcode, in the target Build Phases tab, open the Compile Sources group to reveal the source file list. Double-click the file for which you want to set the flag, enter -fno-objc-arc in the pop-up panel, then click Done.

What is reference counting in Swift?

Swift uses Automatic Reference Counting (ARC) to track and manage your app's memory usage. In most cases, this means that memory management “just works” in Swift, and you don't need to think about memory management yourself.

What does a retain count represent in ARC?

An essential concept in ARC is the retain count, which is a number that keeps track of how many objects are “holding onto” to another object. ARC only applies to reference types such as classes, and not to value types like structs. Value types are copied, so they don't work with references.


1 Answers

  • Click on you project, in the left hand organizer.
  • Select your target, in the next column over.
  • Select the Build Settings tab at the top.
  • Scroll down to "Objective-C Automatic Reference Counting" (it may be listed as "CLANG_ENABLE_OBJC_ARC" under the User-Defined settings group),
  • and set it to NO.

This is on Xcode 4.2 (Build 4D199).

like image 126
NJones Avatar answered Oct 12 '22 08:10

NJones