Simple question.
If I have
BOOL a = [myInst function];
NSAssert(a, @"...")
then I will get warnings in the release build because a is not used. I want to assert a BOOL returned from a function, but I don’t need to use it. How would I fix it?
I can’t put the whole expression into NSAssert because it won’t compile in release.
As long as the expression which results in
adoes not have side-effects, why not put it directly intoNSAssert? E.g.Note that if
<expr>has side-effects, e.g. prints something, this may not happen in non-Debug builds.