typedef NS_OPTIONS(NSUInteger, ListOption) {
ListOption1 = 1 << 0,
ListOption2 = 1 << 1,
ListOption3 = 1 << 2
};
@interface SomeClass : NSManagedObject
@property (nonatomic, retain) NSNumber *listOption;
@end
I save the bit flags to coredata. How to make the fetch predicate like "SomeClass.listOption | ListOption1" Or "SomeClass.listOption & ListOption1"
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((listOption & %llu)>0)", ListOption1];
– lh99998888