> We don?t use NSUserDefaults in the app. Instead we have an 
> NSMutableDictionary that holds the settings, and we write them to a file when 
> they change. We read them in at app startup.
> That allows us to actually have different settings for various items

Yes, that certainly works.

There is, however, a nice feature of NSUserDefaults that you will, I think, 
loose,
or that you will have to implement yourself by hand:
when the app runs for the first time, NSUserDefaults gets populated by the 
(real) defaults that come (more or less) hard-coded with your app.
When a user changes one of those settings himself, then the system will know 
that this is an actual user setting.
Now, if you later change the values of the (real) defaults that come with the 
app, maybe because the new default values are better,
then those new defaults will take effect *except* for those settings that the 
user has changed himself.

> (these are USB devices like mice and keyboards), and allows us to work around 
> the restrictions of NSUserDefaults.
> 
> My only real issue with NSUserDefaults is that you cannot hand edit the prefs 
> file since the system will overwrite your changes with its own cached data.

But you can always change them using the 'defaults' command , can't you?
('defaults write' even takes a plist as argument.)


Best regards, Gabriel


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to