I want to utilize boolean array in Objective C programming. I have got it mostly set up, but the compiler throws a warning at the following statement:
[userObj replaceObjectAtIndex:index withObject:YES];
YES is simply not an object.(This is my view)
It is a primitive, regardless I need to do this, and would greatly appreciate advice on how to accomplish it.
Thankyou.
Tarun Kumar
27-Dec-2015We can do this by wrapping it up in an NSNumber, like this:
or we can use @(YES), it will wraps a BOOL in an NSNumber, like this:
Now, we can use it by pulling out the bool value, like this: