On 2013 Apr 13, at 07:39, Nick Rogers <roger...@mac.com> wrote:

> Is it possible to save the same set of preferences with different profiles in 
> the system provided mechanism or do I have to come up with a scheme of my own 
> (I guess I'd then be storing preferences in a plist in app bundle)?

I don't think that NSUserDefaults has that mechanism.

Using a "scheme of my own" is how the Google Chrome web browser supports 
multiple user profiles.  Preferences are in Application Support.  Each profile 
gets a subfolder in ~/Library/Application Support/Google/Chrome/, which 
contains, among many other things, a JSON "Preferences" file.

I'd also consider layering my profiles into NSUserDefaults somehow.  To do 
this, you'll need to do lots of digging into and out of dictionaries with key 
paths such as "foo.profileName.bar".  I've added a category to NSUserDefaults 
which creates and removes the required subdictionaries automatically, and also 
understands key path "arrays" such as {"foo", profileName, "bar"}. If you're 
interested,

https://github.com/jerrykrinock/CategoriesObjC/blob/master/NSUserDefaults%2BKeyPaths.h





_______________________________________________

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