在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文件中答案 0 :(得分:0)
除非_context
和NSManagedObjectContext
是两个不同的insertObject
,否则您不需要明确调用Product
,因为您已插入新的NSEntityDescriptioninsertNewObjectForEntityForName
+
concat
个对象