I have a library where I am receiving NSConcreteValue and I have no idea how to deal with it. I know the object I am supposed to get is a boolean, so how do i extricate the real value?
That’s a private class that’s sometimes (or all the times?) used behind the scenes when you work with NSValue
. Or at least that’s my impression. I think you should be able to cast to NSValue
:
// assuming value is of type “id”
NSAssert([value isKindOfClass:[NSValue class]],
@"Sorry, I was wrong. Maybe try anyway?");
NSAssert(strcmp(@encode(BOOL), [value objCType]) == 0,
@"The value does not seem to hold a BOOL.");
BOOL unwrappedValue;
[value getValue:&unwrappedValue];
…or something like that, I’m making this up :-)
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