如何从iOS中的NSManageobjectModel中仅获取数据密钥?

时间:2016-10-20 05:41:43

标签: ios objective-c core-data nsmanagedobject

我有一个NSManageObjectModel实例

NSManagedObjectModel *selectedDevice = [self.devices objectAtIndex:tag];

结果是:

<NSManagedObject: 0x6000000b3800> (entity: History; id: 0xd000000000040002 <x-coredata://81B5B713-B1DB-4B22-AF6F-C41D4E093BEC/History/p1> ; data: {
    destinationLang = bn;
    group = arbn;
    sourceLang = ar;
    sourceText = Hhhhhhh;
    transilateText = "Hhhhhhh\n\n\nHhhhhhh";
})

但我想只采取&#34;数据&#34;关键部分。我试过这种方式。

NSManagedObjectModel *selectedDevice = [self.devices objectAtIndex:tag]; 
NSMutableArray *store = [[NSMutableArray alloc]initWithObjects:selectedDevice, nil];
NSMutableArray *index0title = [[store objectAtIndex:0]valueForKey:@"data"];

但是我收到了错误。

0 个答案:

没有答案