1

一切正常,但我收到此通知

并尝试搜索以找到解决方案,但没有运气

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
NSManagedObjectContext *context = appDelegate.managedObjectContext ;
NSString *title = [[Picker delegate]pickerView:Picker titleForRow:[Picker selectedRowInComponent:1] forComponent:1];

NSEntityDescription *entity = [NSEntityDescription insertNewObjectForEntityForName:@"History" inManagedObjectContext:context];
4

1 回答 1

2

在这一行:

NSEntityDescription *entity = [NSEntityDescription insertNewObjectForEntityForName:@"History" inManagedObjectContext:context];

您调用的方法返回一个NSManagedObject. 您将其分配给类型的变量NSEntityDescription。这就是信息告诉你的。

于 2016-04-09T22:44:04.117 回答