我只是构建了一个简单的应用程序,使用 Core Data 从预加载的 SQLite 数据库(在模拟器中运行时由应用程序本身创建)检索数据。填充数据库后,我在 iPhone 模拟器上运行应用程序,一切正常,但是当我在设备上运行它时,我收到以下错误消息:
Cannot create an NSPersistentStoreCoordinator with a nil model
我该如何处理?
最佳答案
你能检查一下你的 xcdatamodel(d) 文件是否链接到你的目标吗?当 .app 包中不存在 xcdatamodel(d) 时,就会发生这种情况。
关于iphone - 核心数据 : Building on Device causes an NSPersistentStoreCoordinator error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5877176/