Xcode程序转储返回空的SQLite coredata生成的文件Xcode app dump returns empty SQLite file generated by coredata

- 此内容更新于:2015-01-27

我想调试我coredata生成数据库。 我下载的应用程序容器,它除了sqlite文件数据。 确保我的更改保存,我退出应用程序。 我怎样才能Sqlite数据文件?


Im trying to debug my coredata generated database.

I've downloaded app container, it has everything except sqlite file with data.

To make sure my changes are saved, I've quit the application.

How can I get Sqlite file with data?


Just debug your managedObjectContext, see the PersistentStoreCoordinator attribute, there is a url to show the real store path. It may be not a file named '*.sqlite', or it may be store in different bundle , or it may be store in the remote server. Just print it out to see.

Saqib Saud的回复:检查出来。

(原文:Checking that out.)

Saqib Saud的回复:我可以确定,我检查正确的道路。也这个问题并不是唯一的我目前的项目,似乎转储可能会从上次返回设备同步。

(原文:I can confirm, Im checking the right path. Also this problem is not unique to my current project, it seems dump might be returned from last time device is synced.)

Feng Lin的回复:为什么你不叫NSManagedObjectContext[保存:]。所以你可以保存数据。然后等到秒下载文件。

(原文:Why do not you call [save:] in NSManagedObjectContext. So you can save the data to it. Then wait until seconds to download file.)

Saqib Saud的回复:好主意,加上itunes似乎和我的设备也有困难。定期给我错误的“同步失败,设备停止responding"。我的手机没有越狱和itunes是最新版本。:(

(原文:good idea, plus it seems that itunes is also having trouble with my device. Its giving me error periodically "Sync failed, device stopped responding". My phone is not jailbroken and itunes is latest version. :()

Feng Lin的回复:我认为你可以尝试另一个设备。

(原文:I think you can try another device.)