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

后端 未结 9 520
终归单人心
终归单人心 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:16

    I saw this error during testing when I spun up some temporary NSManagedObjectContexts without hanging on to them anywhere - the context would get deallocated out from under me at random by ARC.

    What wound up working was to hold a reference to the MOC on the tests and reset it for each test.

    Not sure how relevant this is to non-test circumstances, but particularly if you're using child/sibling contexts, it's worth making sure they're actually still there. :P

提交回复
热议问题