CoreData 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'

后端 未结 9 468
终归单人心
终归单人心 2020-12-24 02:58

I have been following these instructions to help integrate iCloud support with CoreData and I am getting some errors.

I have this in my AppDelegate:

         


        
相关标签:
9条回答
  • 2020-12-24 03:24

    Resolved by moving the let moc = DataController().managedObjectContext to the top of the class rather than leaving inside of the func seedPerson()

    0 讨论(0)
  • 2020-12-24 03:25

    I had the same problem and my solution was to delete the application and install it again because of modifications in database.

    0 讨论(0)
  • 2020-12-24 03:30

    I had the same problem. The reason I was getting the error was because I had made some minor changes in my CoreData Entity schema( Basically I added 2-3 new attributes). And I forgot about it as it does not give any errors until we run it. So what happens is, the app which was running earlier already had the persistent store with the previous schema. So the new schema is pointing to the same store. That is why we het the error when we run it as we try to access the new attributes.

    Solution : Delete the app from the device/simulator. And reinstall it. (The new build will have the new schema and hence won't crash.)

    0 讨论(0)
提交回复
热议问题