1

I am trying to filter an array of NSManagedObjects by deleted = NO this filtering does not work. The deleted field has a default value so nil should not be an issue.

Kyle Redfearn
  • 2,172
  • 16
  • 34
  • possible duplicate of [Core Data NSPredicate predicateWithBlock and predicateWithFormat in Parent Child Context](http://stackoverflow.com/questions/16000242/core-data-nspredicate-predicatewithblock-and-predicatewithformat-in-parent-child) – Martin R Mar 05 '14 at 05:40

2 Answers2

2

The answer to this question is to change the field name. There are some secret reserved words used in CoreData that are not apparent. I have had issues with other fields called address1 and name too. This person has also had problems with readOnly: http://lists.apple.com/archives/cocoa-dev/2007/Nov/msg00412.html

Kyle Redfearn
  • 2,172
  • 16
  • 34
0

comparing your BOOL in an NSPredicate this way should work:

[NSPredicate predicateWithFormat:@"deleted == %@", [NSNumber numberWithBool: NO]];