1

NSEntityDescription在模拟器 iOS 6.0 中运行良好,但我无法在具有 ios6.1 及更高版本的 iPhone 设备中运行我的代码,由于未捕获的异常“ NSInvalidArgumentException”,它给出了类似终止应用程序的异常,原因:executeFetchRequest:error: A fetch request must have an entity.

我的代码是:

NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];

NSEntityDescription *entity = [NSEntityDescription entityForName:@"Wager" inManagedObjectContext:self.managedObjectContext];

[fetchRequest setEntity:entity];
4

0 回答 0