Mac应用程序的NSUserDefaults数据存储在哪里? [英] Where is a Mac Application's NSUserDefaults Data Stored?
本文介绍了Mac应用程序的NSUserDefaults数据存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用NSUserDefaults在我的应用程序中存储一些数据。
I am using NSUserDefaults to store some data in my application.
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:@"dummy string" forKey:@"lastValue"];
[prefs synchronize];
为了测试的目的,我需要看到系统首选项plist文件,其中我的NSUserDefaults数据在Mac上保存。
For testing purposes I need to see the System Preferences plist file where my NSUserDefaults data is saving on the Mac.
我知道iOS应用程序用户默认存储的位置,但我不知道mac应用程序。
I know where the iOS application user defaults are stored, but I don't know about mac application. Where is a Mac Application's NSUserDefaults Data Stored?
推荐答案
它们可以在多个位置找到:
They can be found in more than one place:
~/Library/Preferences/com.example.myapp.plist
~/Library/SyncedPreferences/com.example.myapp.plist
如果沙盒
~/Library/Containers/com.example.myapp/Data/Library/Preferences/com.example.myapp.plist
~/Library/Containers/com.example.myapp/Data/Library/SyncedPreferences/com.example.myapp.plist
这篇关于Mac应用程序的NSUserDefaults数据存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文