Cannot create an NSPersistentStoreCoordinator with a nil model

前端 未结 27 1100
囚心锁ツ
囚心锁ツ 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:22

    What's probably happened is that your xcdatamodeld file from Apple's source code has turned into a xcdatamodel(without the d) file and therefore they aren't considered the same.

    The quickest way to fix this, is to select the xcdatamodel file in your project navigator and in to the menu bar

    Editor->Add Model Version...

    and add a new version of your model. Make all changes to the new version.

    This works in Xcode 5

提交回复
热议问题