I am using NSAssert() calls within an iPhone application and my understanding from the Apple docs is that assertions are not compiled into the code if NS_BLOCK_ASSERTIONS is defined.
To turn off assertions, in a header file I declare: #define NS_BLOCK_ASSERTIONS
If you created your Xcode project based on one of the standard templates, the Cocoa headers (includingNSException.hwhich
contains theNSAssertmacros)
will get preprocessed before any other files in the project. A#define
NS_BLOCK_ASSERTIONSin any of the project's header or implementation files therefore has no effect on theNSAssertmacros.
Try puttingNS_BLOCK_ASSERTIONSinto
the preprocessor macros of your target or even project (for the release configuration only):
Or put#define
NS_BLOCK_ASSERTIONSinto the precompiled header before the#import
<Cocoa/Cocoa.h>or#import
<Foundation/Foundation.h>lines.
I am using NSAssert() calls within an iPhone application and my understanding from the Apple docs is that assertions are not compiled into the code if NS_BLOCK_ASSERTIONS is defined.
To turn off assertions, in a header file I declare: #define NS_BLOCK_ASSERTIONS
If you created your Xcode project based on one of the standard templates, the Cocoa headers (includingNSException.hwhich
contains theNSAssertmacros)
will get preprocessed before any other files in the project. A#define
NS_BLOCK_ASSERTIONSin any of the project's header or implementation files therefore has no effect on theNSAssertmacros.
Try puttingNS_BLOCK_ASSERTIONSinto
the preprocessor macros of your target or even project (for the release configuration only):
Or put#define
NS_BLOCK_ASSERTIONSinto the precompiled header before the#import
<Cocoa/Cocoa.h>or