保存核心数据

时间:2015-07-14 07:24:53

标签: ios objective-c

在abcViewController.m

new File(fileName).withInputStream { is ->
         workbook = new XSSFWorkbook(is)
         //Getting JAVA Heap Size exception here when I am trying to create  an object 
      }
AppDelegate中的

saveContext包含

Product *pro = [NSEntityDescriptioninsertNewObjectForEntityForName:@"Product" inManagedObjectContext:_appDelegate.managedObjectContext];   
        pro.name = _nameText.text;
        [_context insertObject:pro];
        [_appDelegate saveContext];

需要“[_context insertObject:pro];”在abcViewController.m中从上下文????

保存到coreData文件中

1 个答案:

答案 0 :(得分:0)

除非_contextNSManagedObjectContext是两个不同的insertObject,否则您不需要明确调用Product,因为您已插入新的NSEntityDescriptioninsertNewObjectForEntityForName +

concat个对象