我想获取我存储到我的核心数据对象之一的信息并将此数据存储到NSArray
对象NSDictionary
中,以便我可以将此数组发送到我的一个视图并在表格视图中显示数据。
但是我不太确定如何NSDictionary
进入NSArray
,这是我的 fetch 请求,希望有人可以帮我把它NSDictionary
放入NSArray
.. 我不知道如何做到这一点,因为我是如何循环的核心数据对象。
// Test listing all FailedBankInfos from the store
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Manuf" inManagedObjectContext:context];
[fetchRequest setEntity:entity];
NSError *error;
NSMutableDictionary *tempManufacturerDictionary = [[ NSMutableDictionary alloc] init];
NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&error];
for (Manuf *manuf in fetchedObjects) {
[tempManufacturerDictionary setObject:manuf.hasMod forKey:@"HASMOD"];
[tempManufacturerDictionary setObject:manuf.isLocked forKey:@"ISLOCKED"];
[tempManufacturerDictionary setObject:manuf.isReg forKey:@"ISREG"];
[tempManufacturerDictionary setObject:manuf.main forKey:@"MAIN"];
// How do I put the Dictionary above into an array?
}
任何帮助,将不胜感激。