Search code examples
objective-ccocoamacosnsuserdefaultscfpreferences

NSUserDefaults vs CFPreferences, what to consider


Apple provides documentation for managing user preferences through both Core Foundation and Foundation Kit. It also doesn't offer any help with choosing one or another, except for stating that they're indeed different ("not toll-free bridged").

So, I'm interested, is there anything I should consider selecting configuration mechanism for the application? Or should I just toss a coin?

Thanks!


Solution

  • You are supposed to use NSUserDefaults, which is absolutely the default choice. I suppose you could use CFPreferences, but unless you had a good reason to make that choice, I'd steer clear of CF-APIs.