轻松查看已保存的NSUserDefaults? [英] Easy way to see saved NSUserDefaults?
问题描述
有没有办法直接查看保存到 NSUserDefaults
的内容?我想看看我的数据是否正确保存。
Is there a way to see what's been saved to NSUserDefaults
directly? I'd like to see if my data saved correctly.
推荐答案
如果你去,你可以在模拟器中找到你的应用程序的pList文件:
You can find the pList file for your app in the simulator if you go to:
/ users / 您的用户名 / Library / Application Support / iPhone Simulator /< Sim Version> / Applications
/users/your user name/Library/Application Support/iPhone Simulator/<Sim Version>/Applications
此目录有一堆名为GUID的目录。如果您正在开发一些应用程序,那么会有一些应用程序。所以你需要找到你的应用二进制文件:
This directory has a bunch of GUID named directories. If you are working on a few apps there will be a few of them. So you need to find your app binary:
find . -name foo.app
./1BAB4C83-8E7E-4671-AC36-6043F8A9BFA7/foo.app
然后转到GUID目录中的Library / Preferences目录。所以:
Then go to the Library/Preferences directory in the GUID directory. So:
cd 1BAB4C83-8E7E-4671-AC35-6043F8A9BFA7/Library/Preferences
你应该找到一个如下文件:
You should find a file that looks like:
<Bundle Identifier>.foo.pList
在pList编辑器中打开它并浏览持久化你内心的价值观。
Open this up in the pList editor and browse persisted values to your heart's content.
这篇关于轻松查看已保存的NSUserDefaults?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!