Sync core data database/ .sqlite file to Dropbox

杀马特。学长 韩版系。学妹 提交于 2019-12-03 21:02:24

The SQLite file is wherever you created it. There's no mystery-- you have to tell Core Data where you want the file, and it goes where you say it should go.

If you used one of Apple's project templates you probably have a line in your app delegate class (in the persistentStoreCoordinator method) that looks like

NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MyApp.sqlite"];

That's where it is, and that's how you should find the file path in your app.

That might be everything. If you're not using binary attributes with "Allows External Storage" checked, it's the entire data store. If you are using those, there's a parallel, hidden directory whose name is undocumented that contains the external binaries.

Copying the data store to Dropbox is not likely to be useful. You cannot sync your data store from one device to another this way-- data corruption is virtually guaranteed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!