How do I wrap this BAIL macro in Xcode?
- by willc2
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?