我想在不运行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
如何从阵列中获取列表以避免循环?