What's the "DNS_BLOCK_ASSERTIONS" (C compiler flag)?
Asked
Active
Viewed 8,442 times
42
-
Actually `-DNS_BLOCK_ASSERTIONS` is the flag. See the comment on the Answer explaining the flag is `-D` is the flag, and `NS_BLOCK_ASSERTIONS` is its parameter. Ex in Xcode: `-DNS_BLOCK_ASSERTIONS=1`. Confusingly, this flag has no space between itself and its parameter. I am adding this comment to help get hits on this page with search engines. – Basil Bourque Feb 06 '17 at 03:46
1 Answers
64
The NS_BLOCK_ASSERTIONS macro (no "D") suppresses the checks performed by NSAssert. You supply it to the compiler using -DNS_BLOCK_ASSERTIONS
(see the comments for an explanation of the "D").

Marcelo Cantos
- 181,030
- 38
- 327
- 365
-
17Just to clarify, `-D` defines a constant, and it is one of the confusing flags that doesn't have a space between it and it's parameter. – Matthew Scharley May 02 '10 at 06:00