It looks like you messed up the c array with objc NSArray. NSArray is more like a list in Java, in which you can add objects, but not values ββlike NSInteger, BOOL, double, etc. If you want to store such values ββin NSArray, you first need to create a mutable array:
NSMutableArray* array = [[NSMutableArray alloc] init];
And then add the appropriate object to it (in this case we will use NSNumber to store your BOOL value):
[array addObject:[NSNumber numberWithBool:yourBoolValue]]
And that is pretty much! If you want to access the bool value, just call:
BOOL yourBoolValue = [[array objectAtIndex:0] boolValue];
Cheers, Pawel
Pawel
source share