I’ve ran into this problem and so far I can’t find any answers. so a have a BOOL property and I am trying to set it to YES/TRUE/true ( I have tried them all) but whenever I check the BOOL it always returns NO/FALSE/false. Below is my code
[myObject setAllowReg:YES];
myObject.allowReg = YES;
if (myObject.allowReg)
{
NSLog(@"YES");
}
else
{
NSLog(@"NO");
}
The output to this is always “NO”. This must be something really simple that I am missing but it seems whatever I try doesn’t work.
Thanks
Beat guess is that
myObject.allowRegisniland probablymyObjectisnil.Add some NSLog statements to help figure this out:
Advice: In debugging break everything down to the simplest statements and test each step along the way.