how to use NSPredicate to satisfy multiple conditions
NSEntityDescription *entity = [NSEntityDescription entityForName:@"MessageData" inManagedObjectContext:managedObjectConte开发者_如何学编程xt];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"msg_id = %@",msg_id];
[fetchRequest setPredicate:predicate];
i need to fetch objects in which msg_id = values in a array
You can do "msg_id IN %@", array
.
精彩评论