Archive

Posts Tagged ‘User Experience’

Keeping User Defaults Synchronized with Settings.bundle

08/12/2009 3 comments

The first time you wade into the NSUserDefaults system in Cocoa, you feel sweet relief wash over you. Managing user preferences in any application can be a very tiresome chore. NSUserDefaults is like hiring a housekeeper, only it doesn’t cost you anything.

Excited with the possibilities, you dive in. You quickly have your Settings.bundle added to your project and your settings menus built. It all looks impressive, and only took a few hours. Woo hoo! You launch your app to watch this sorcery in action, when—bang! The app crashes. Not cool. A little debugging shows that the defaults you created on the root page work fine, but only if you open the your app’s Settings page before launching the program. And child menus have the same problem, except that users have to navigate to each child menu before the defaults work. You imagine the reaction you’ll get when you explain this to your users: I have to do whaaaat?

Read more…

Advertisements