【发布时间】:2011-01-17 22:25:43
【问题描述】:
我正在尝试使用 CoreData 中的迁移功能。我遵循了 Apple 文档。我在以下方法中遇到了问题:
/**
Returns the managed object model for the application.
If the model doesn't already exist, it is created by merging all of the models found in the application bundle.
*/
- (NSManagedObjectModel *)managedObjectModel {
if (managedObjectModel != nil) {
return managedObjectModel;
}
/*
* NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil'
* 2010-02-17 16:27:15.338 Patrimoine[3037:207]
*/
managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
return managedObjectModel;
}
http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html上好像也有同样的问题
但我确实选择了 Apple 建议的方法,通过使用菜单选项“添加模型版本”。
你有什么想法吗?
【问题讨论】:
标签: iphone core-data core-data-migration