Having trouble wrapping a BOOL value in NSValue.
I tried this:
[NSValue valueWithPointer:[NSNumber numberWithBool:YES]]
An NSNumber
is an NSValue
subclass. As such,[NSNumber numberWithBool:YES]
is already wrapping it in an NSValue
for you.
Actually NSNumber is a heavier-weight descendant of NSValue. If you actually want to use an NSValue here's how you'd do that:
BOOL bool_value = YES;
[NSValue valueWithBytes:&bool_value objCType:@encode(BOOL)]
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