我想在不运行 for 循环的情况下从数组的内容中设置一个列表。我使用该appendEntities
方法来实现这一点。
NSMutableArray *mutArray = [[[self tempList] makeArray] mutableCopy];
[mutArray filterUsingPredicate :aPredicate];//Setting a user defined predicate format here.
NSArray *newListArray = [NSArray arrayWithArray:mutArray];
//After setting the predicate I want the array content to be present in the entityList.
ISTModelList *entityList = [[ISTModelList alloc] init];
[entityList appendEntities:newListArray];
NSLog(@"entityList %@",entityList);
当我尝试打印列表时,在调试器控制台中出现以下错误。
-[__NSCFDictionary setContextKey:]: unrecognized selector sent to instance 0x10aca9090
如何从数组中获取列表以避免循环?