George
George

Reputation: 3619

Xcode 5 Objective-C Automatic Reference Counting setting

In Xcode 5, I create a project named myproject, in the project's Build Settings I can set Objective-C Automatic Reference Counting to YES in order to use ARC. Then there is a target also named myproject, what if in the target's Build Settings page I set Objective-C Automatic Reference Counting to NO, does this mean eventually I'll use manual memory management? Do I have to set both of the two boolean flag to the same value, either YES for ARC or NO for manual memory management?

Upvotes: 1

Views: 2742

Answers (2)

Tushar Koul
Tushar Koul

Reputation: 2980

Project settings will get applied to all your targets. Individual target settings will override project settings.

SO if you put YES in project settings and NO in only one particular target..effectively your boolean value is NO for that target. And it'll remain YES for all other targets (where you haven't modified the settings)

Upvotes: 3

Nikos M.
Nikos M.

Reputation: 13783

Yes, both should have the same value (YES or NO). The first is for the project (so xcode warns you when you write code not compatible with arc) and the second in the target settings is for the compiler, so the compiler can add all the retain/release code for you if you have ARC YES.

Upvotes: 1

Related Questions