开发者

Settings.bundle vs NSUserDefaults

I have my settings.bundle configured to show 4 settings, which I want user to access/change. During applica开发者_StackOverflow社区tion lifetime I have another couple of values, that i store in NSUserDefaults, but I'm not interested them to show up in the Settings.app. Is it possible at all that the number of values in settings.bundle will be different from actual number of key/value pairs, stored in the NSUserDefaults? What has to be done in order to manage it properly?

Thanks,


Key/value pairs in your Settings bundle are managed by [NSUserDefaults standardUserDefaults], but there's nothing to stop you from adding your own keys and values to manage. They won't show up in the Settings screen for your app unless you add them to the bundle's property list.

Just register, store and retrieve user defaults the same way whether from your Settings bundle or not; there's nothing additional that needs to be done.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜