0
我想篩選我擁有的NSDictionaries數組。如何使用NSPredicate篩選NSArray
這是我的過濾器目前看起來像
NSDictionary *selectedItemDictionary = [sortedItemsArray objectAtIndex:indexPath.row];
NSMutableArray *sortedItemsMutableArrayCopy = [sortedItemsArray copy];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"dpc like %@", [selectedItemDictionary objectForKey:@"dpc"]];
[sortedItemsMutableArrayCopy filterUsingPredicate:predicate];
這是我的selectedItemDictionary看起來像
dc = 3;
Cmp = F;
Qty = 0;
dp = 0;
用途不同,我想通過sortedItemsArray搜索和做出任何新的數組它具有與我的UITableViewCell中選定行相同的直流數字。 但是上面我reciving這個錯誤
-[__NSArrayI filterUsingPredicate:]: unrecognized selector sent to instance
任何幫助,將不勝感激的代碼。
是的,多數民衆贊成正是我剛纔實現可變數組看着蘋果文檔再次..非常感謝您的回答將迎來它很快改正。 – HurkNburkS