您的位置:首页 > 其它

NSUserDefaults数据存储在什么地方

2014-03-30 16:44 495 查看


Where
is a Mac Application's NSUserDefaults Data Stored?

15down
votefavorite

7

I am using NSUserDefaults to store some data in my application.
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:@"dummy string" forKey:@"lastValue"];
[prefs synchronize];


For testing purposes I need to see the System Preferences plist file where my NSUserDefaults data is saving on the 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?

objective-c osx cocoa plist nsuserdefaults
share|improve
this question
edited Feb
3 '13 at 3:07




Sam

3,33063367

asked Nov 2 '11 at 15:15





ahmadbaig

16618

add
comment


2 Answers

activeoldestvotes

up
vote47down
voteaccepted
They can be found in more than one place:
~/Library/Preferences/com.example.myapp.plist
~/Library/SyncedPreferences/com.example.myapp.plist


and if sandboxed
~/Library/Containers/com.example.myapp/Data/Library/Preferences/com.example.myapp.plist
~/Library/Containers/com.example.myapp/Data/Library/SyncedPreferences/com.example.myapp.plist


share|improve
this answer
edited Sep
28 '12 at 11:49

answered Sep 28 '12 at 10:10

For testing purposes I need to see the System Preferences plist file where my NSUserDefaults data is saving on the 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?

objective-c osx cocoa plist nsuserdefaults
share|improve
this question
edited Feb
3 '13 at 3:07




Sam

3,33063367

asked Nov 2 '11 at 15:15





ahmadbaig

16618

add
comment


2 Answers

activeoldestvotes
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: