如何查看存储在核心数据中的数据? [英] How to view data stored in Core Data?
问题描述
我正在为我的应用程序创建一个核心数据模型.我希望能够查看其内部以查看存储在其中的内容.
I'm creating a Core Data model for my application. I would like to be able to look inside it to see what I have stored in there.
是否有比搜索后备存储更容易的方法(我的应该是SQLite)并从那里读取?看起来不太像苹果.
Is there an easier way than searching for the backing store (mine should be SQLite) and reading it from there? Doesn't seem very Apple-esque.
推荐答案
一旦您的应用程序已在模拟器中运行并创建了持久性存储文件,您就可以在应用程序的文档"目录中找到该文件.
Once your app has run in the simulator and created the persistent store file, you can find the file in your app's Documents directory.
您的应用程序数据将位于文件夹中(〜是您的主目录):
Your app data will be folder inside (~ is your home directory):
~/Library/Developer/CoreSimulator/<device>
在XCode 6之前的版本中,路径为:
In versions prior to XCode 6, the path was:
~/Library/Application Support/iPhone Simulator/User/Applications/
我按修改日期"排序以查找刚构建的应用.
I sort by "Date Modified" to find the app that I just built.
要查看SQLite文件,请检出基础和/或
For viewing a SQLite file, check out Base and/or Core Data Editor.
这篇关于如何查看存储在核心数据中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!