开发者

Can NSUserDefaults be used to read/write system preference plists?

开发者 https://www.devze.com 2023-03-24 12:09 出处:网络
I\'m writing a small preference pane that needs to load and write a preferences plist created by the system. I know this can be done by manually loading the plist as a dictionary and going from there,

I'm writing a small preference pane that needs to load and write a preferences plist created by the system. I know this can be done by manually loading the plist as a dictionary and going from there, but I was curious if it might be possible to use NSUserDefaults to do the job instead. It would cut the needed code down and would be more convenient if possible.

Does anyone have experie开发者_如何学Cnce with this?


You can use NSUserDefaults only with preferences for the current application, though for any user. You can use CFPreferences to change the defaults for other applications, or NSDictionary if you want to read/write the plists directly.

0

精彩评论

暂无评论...
验证码 换一张
取 消