Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 equivalent of NS_BLOCK_ASSERTIONS in Build Settings

Until Xcode 5, Release builds could be prevented from including NSAssert statements and their variants, using the default Build Setting:

OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";

This setting can be found in project.pbxproj and is set in Xcode here:

enter image description here

(Note that this grab was taken from an Xcode 4 project converted to Xcode 5.)

Each target would inherit this setting in the Release build only. Obviously this was a good thing. Rather than crash immediately, the app would possibly struggle on regardless. Whereas for Debug builds, you want to know immediately when an NSAssert fails.

However, I am struggling to find the equivalent in Xcode 5.

Creating a new project using the default templates shows no equivalent setting:

enter image description here

My question is, what is the equivalent setting in Xcode 5, or does NS_BLOCK_ASSERTIONS have to be added manually to Other C Flags for the Release build?

like image 427
Max MacLeod Avatar asked Dec 04 '13 14:12

Max MacLeod


1 Answers

It's got it's own setting field now! Enable Foundation Assertions. Set your debug as yes and your release as no, as shown in screen grab below.

enter image description here

Note: You need to click All in the top left in your build settings tab to see it, you can see in my screen grab the blue ALL in the top left.

like image 101
BooRanger Avatar answered Oct 30 '22 03:10

BooRanger