Querying Core Data with Predicates - iPhone

后端 未结 4 1203
故里飘歌
故里飘歌 2020-12-25 08:56

So I\'m trying to fetch objects from core data. I have list of say 80 objects, and I want to be able to search through them using a UISearchBar. They are displayed in a tab

4条回答
  •  再見小時候
    2020-12-25 09:05

    use contains[cd] instead of like, and change:

    NSPredicate *predicate =[NSPredicate predicateWithFormat:@"All"];

    to:

    NSPredicate *predicate =[NSPredicate predicateWithFormat:@"1=1"];

提交回复
热议问题