how to use NSPredicate to satisfy multiple conditions
NSEntityDescription *entity = [NSEntityDescription entityForName:@"MessageData" inManagedObjectContext:managedObjectContext];
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With