Cannot create an NSPersistentStoreCoordinator with a nil model

前端 未结 27 1291
囚心锁ツ
囚心锁ツ 2021-01-30 03:33

Been having my first crack at Core Data and I\'m getting the following error when running my code on my device, but it works fine on the simulator..

*

27条回答
  •  自闭症患者
    2021-01-30 04:26

    If someone is stuck because of the same issue. Make sure you have properly linked the database (as you might have copied the code directly from some example).
    Just update the name of the database in managedObjectModel and persistentStoreCoordinator methods in AppDelegate.

提交回复
热议问题