David David - 6 months ago 51
iOS Question

Comparing data from NSNumber CoreData iOS

I've got in CoreData a

@property (nonatomic, retain) NSNumber * hidden;

which is Boolean. I am trying using following code
[object valueForKey:@"hidden"]

How can I compare the returned value, to use it in

if ([[object valueForKey:@"hidden"] isEqualToString:@"1"])

doesn't work


You can query the bool value of an NSNumber using [[object valueForKey:@"hidden"] boolValue] and that way you can do proper bool handling.