Core Data: how to just delete and rebuild the data store?

后端 未结 3 895
逝去的感伤
逝去的感伤 2021-02-03 12:54

I\'m using Core Data in an iOS 7+ app that does not need to save user\'s data, all data the app needs is requested to services and it can be recovered at any time.

3条回答
  •  情书的邮戳
    2021-02-03 13:56

    I think destroyPersistentStoreAtURL method of NSPersistentStoreCoordinator is what you want.

    It will remove the data store and journal files and all other things that need to be removed.

    Look at Apple documentation.

提交回复
热议问题