The code shouldn't have any effect It should be doable anywhere It doesn't generate compiler warning
Basically sometimes I want to do NSAssert. However, rather than NSAssert, I sometimes want to do my if {} my self. That way I can just easily set or unset the break point
Currently this is what I do.
if (entityName==@"Business")
{
error=nil; //Some code for breakpoint. I want something that do nothing actually.
}
It's just happen that I have a variable named error that I will no longer use. But what would be a goodalternative
I also tried [nil donothing]; but that got compiler error.
Try this:
while (false);
There are other possibilities, like if (false)
or even just a line with a lone semicolon ;
, but in those cases execution stops at the next instruction, possibly because the compiler simply eliminates those empty bits of code. Using while
has the advantage that execution will stop on that line (assuming you put a breakpoint there, of course).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With