Cannot create an NSPersistentStoreCoordinator with a nil model

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

    I faced this same error when i renamed the .xcdatamodel file from xcode and changed the renamed name in app delegate wherever it was needed, but i still got the same error. None of the suggested procedure worked for me.

    Then I opened the folder in Finder and found an additional file .xccurrentversion along with .xcdatamodel file. I opened it up in TextEdit app and changed this:

    
        _XCCurrentVersionName
        Your_Renamed_Model_FileName.xcdatamodel
    
    

    I am using this with Xcode 6.4, OSX Yosemite 10.10.1

    I hope it helps!

提交回复
热议问题