0

I have a boolean attribute in Coredata named "hide". In the nsmanagedobject file, the variable is an NSNumber.

@property (nonatomic, strong) NSNumber *hide;//bool

In some cases, I want to exclude or "hide" items where the value of hide is 1. The predicate I am using for this is:

hideClause = @"hide != 1";
hidePred =  [NSPredicate predicateWithFormat:hideClause];

However, the logic is not working as expected. The FRC is not returning items even when I know for sure the value of hide is not 1.

Can anyone see what might be wrong?

user6631314
  • 1,751
  • 1
  • 13
  • 44

1 Answers1

0

Use below predicate :

hidePred = [NSPredicate predicateWithFormat:@"hide != %@", [NSNumber numberWithBool:YES]]
Vinit Ingale
  • 381
  • 1
  • 4
  • 17