I have this code:
BOOL booleanValue = TRUE;
[arrayZone replaceObjectAtIndex:indexZone withObject:booleanValue];
This code gives me a warning that says:
incompatible integer to pointer conversion: sending BOOL to parameter of type 'id'
Why?
You need to box your BOOL
with a NSNUmber
like this:
BOOL booleanValue = TRUE;
[arrayZone replaceObjectAtIndex:indexZone withObject:[NSNumber numberWithBool:booleanValue]];
Then, to retrieve your BOOL
value, you unbox it using boolValue
:
BOOL b = [[arrayZone objectAtIndex:index] boolValue];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With