查看NSUserDefaults文件内容 [英] See NSUserDefaults file content

查看:160
本文介绍了查看NSUserDefaults文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以查看NSUserDefaults的内容?我可以从终端使用"pico"打开plist文件,但是它显示了奇怪的字符,实际上我看不到内容文件的内容.有什么办法可以在Xcode中打开文件?

Is there any way I can see the content of NSUserDefaults? I'm able to open the plist file using "pico" from the terminal, but it shows weird characters, I can't actually see the content file content. Is there any way I can open the file in Xcode?

基本上,我希望无需编程即可查看和编辑NSUserDefaults的内容,我想从终端或Xcode进行. 干杯!

Basically, I want to be able to see and edit the content of NSUserDefaults without the need of doing so programmatically, I'd like to do so from the Terminal or from Xcode. Cheers!

推荐答案

我可以使用"pico"打开文件,但显示奇怪的字符.

I'm able to open the file using "pico" but it shows weird characters.

由于优化(存储空间和读写速度),iOS以二进制格式存储属性列表文件.您需要使用

Because as an optimization (storage space and read/write speed) iOS stores property list files in the binary format. You need to convert it to XML format using

plutil -convert xml1 com.yourapp.bundleid.plist

此后,在文本编辑器(如Pico)中打开后,您将能够看到有意义的结果.

After this, you'll be able to see a meaningful result when opened in a text editor (such as Pico).

这篇关于查看NSUserDefaults文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆