开发者

nspredicate multiple items from an array

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜