iOS CoreData NSPredicate to query multiple properties at once

后端 未结 8 1824
刺人心
刺人心 2020-12-23 22:39

I am trying to use a UISearchBar to query multiple properties of a NSManagedObject I have a NSManagedObject called Person

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 22:55

    For Swift:

    var predicate = NSCompoundPredicate(
            type: .AndPredicateType,
            subpredicates: [predicate1, predicate2]
        )
    

提交回复
热议问题