How do I wrap this BAIL macro in Xcode?
Posted
by
willc2
on Stack Overflow
See other posts from Stack Overflow
or by willc2
Published on 2010-12-25T03:48:13Z
Indexed on
2010/12/25
3:54 UTC
Read the original article
Hit count: 226
I use this little snippet to halt my iPhone app in the simulator.
NSAssert((0), @"Bail early while testing");
When I try to make it a #defined macro like this:
#define BAILNOW (NSAssert((0), @"Bail early while testing"))
I get this build error:
error: expected expression before 'do'
It seems to be related to the nesting of the NSAssert() macro but I'm at a loss as to how to get around it. Should I dig into the NSAssertionHandler docs or is there some simpler way to halt the app in it's tracks? Or should I just set a breakpoint and get on with my life?
© Stack Overflow or respective owner