Take the 2-minute tour ×  I am trying to save a boolean database
value into a map as follows -  [recentTags setValue:[NSNumber
numberWithBool:[aMessage isSet]] forKey:[aMessage tagName]];  It
gives me an error saying "Incompatible pointer to integer
conversion sending BOOL * aka signed char* to 'BOOL' aka signed
char"  How would I insert a BOOL* into the dictionary?
share|improve this question Why does -isSet return BOOL *
instead of BOOL? –  Bavarious Nov 21 '11 at 8:15  2 Answers 2
up vote 28 down vote accepted  Wrap the BOOL in an NSNumber:
NSNumber *boolNumber = [NSNumber numberWithBool:YES];  To get it
out:  BOOL b = [boolNumber boolValue];  You can wrap other non-
object types (such as a pointer or a struct) in an NSValue.
EDIT: Assuming you really mean a BOOL* (pointer):  NSValue
*boolValue = [NSValue value:pointerToBool
withObjCType:@encode(BOOL*)]; BOOL *b = [boolValue
pointerValue]; share|improve this answer As you can see in my
question I am already doing that but it's not working for me.
That i