2
我有一個NSMutableArray
它有幾個像這樣的字典對象。如何使用謂詞在NSMutableArray上搜索某些東西
"DisplayName": "ART42 - Jomon Williams",
"DisplayName2": "Jomon Williams",
"EmployeeNumber": "ART42",
"Designation": "Senior Executive - Systems",
我有一個UITextField
時,其文字改變我想重裝我UITableView
與搜索過濾陣列。爲了搜索,我做了這樣的事情。當我的文字正在改變時,我會這樣做。
NSPredicate *exists = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", searchText];
NSLog(@"Predicate-------%@",exists);
NSArray *aList = [mutArrayStaff filteredArrayUsingPredicate:exists];
我想通過DisplayName2
鍵搜索。每次我的aList
數組都是空的。如何正確書寫我的謂詞,以便搜索DisplayName2
請幫助我。 感謝
你得到解決? – user3182143