查看保存的 NSUserDefaults 的简单方法?

编程入门 行业动态 更新时间:2024-10-25 16:26:03
本文介绍了查看保存的 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//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 的简单方法?

本文发布于:2023-10-28 19:52:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537612.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:简单   方法   NSUserDefaults

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!