I have two entities called folder and file, Folder has one to many relationship with file entity. File entity has a property called completedStatus which is a BOOL. I need to check which all files have this completedStatus == TRUe IN a particular folder.file NSOrderedSet.
For this I tried this way, by reading the docs, but it is not working
[NSPredicate predicateWithFormat:@"completedStatus = 1 IN %@", file.note]];
So Please help me out.
Regards
Ranjit
This should do what you want:
UPDATE:
NSOrderedSetdoes not have methods to filter with predicates. But you can convert the ordered setfolder.fileto an array:and then continue as above.
Alternatively, you can make a fetch request on the File entity with the predicate
assuming that you have defined the inverse relationship
folderfrom the File entity to the Folder entity.