NSPredicate with AND and OR questions
I have the following NSPredicate:
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"url = %@ AND type = %@ OR type = %@", newsStory.url, [NSNumber numberWithInt:StoryHighlighted], [NSNumber numberWithInt:StorySavedAndHighlighted]];
I wanted to get history with that specific url and type (highlighted or highlighted and saved). However, the above query doesn't work. What am I doing wrong?
0
source to share
2 answers