views:

258

answers:

1

I have a preference pane bundle (it runs in the System Preferences). I designed the interface using Interface Builder where I binded a "start automatically" checkbox to the Shared User Defaults. This works great but it writes the preference to com.apple.systempreferences. I would like to keep my preferences in the com.example.mybundle defaults. How do I do this?

I suppose I need to add a User Defaults controller in Interface Builder but how can I tell it to map with com.example.mybundle?

Thank you all!

+1  A: 

You'll want to bind to an NSDictionaryController whose persistence is managed through -[NSUserDefaults persistentDomainForName:] and -[NSUserDefaults setPersistentDomain:forName:] although it's frankly just as easy to use +[NSDictionary dictionaryWithContentsOfFile:] and -[NSDictionary writeToFile:atomically:].

Graham Lee