2
votes
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"

1
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((listOption & %llu)>0)", ListOption1];lh99998888
Is that comment an answer to your own question? If so, then you should add it as an answer, not a comment.pbasdf

1 Answers

0
votes
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((listOption & %llu)>0)", ListOption1];