【问题标题】:nspredicate multiple items from an arraynspredicate 数组中的多个项目
【发布时间】:2011-09-05 13:12:13
【问题描述】:

如何使用NSPredicate来满足多个条件

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];

我需要获取 msg_id = 数组中的值的对象

【问题讨论】:

    标签: iphone core-data nspredicate


    【解决方案1】:

    你可以"msg_id IN %@", array

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-27
      相关资源
      最近更新 更多