开发者

How to save application preferences in Mac OS?

开发者 https://www.devze.com 2023-03-26 22:08 出处:网络
Is there a native way to save preferences in Mac OS ? Can I write preferences into application package content开发者_如何学Go directory ?The NSUserDefaults class is the standard way to save applicati

Is there a native way to save preferences in Mac OS ?

Can I write preferences into application package content开发者_如何学Go directory ?


The NSUserDefaults class is the standard way to save application preferences.

There are a number of tutorials / examples online (Google is your friend):

NSUserDefaults Tutorial


The native way is to use NUSuserDefaults. You won't want to write into the application directory for a number of reasons, not least because different users can have different preferences.

0

精彩评论

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