• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: multiple profiles in preferences mechanism
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple profiles in preferences mechanism


  • Subject: Re: multiple profiles in preferences mechanism
  • From: Jerry Krinock <email@hidden>
  • Date: Sat, 13 Apr 2013 08:56:23 -0700

On 2013 Apr 13, at 07:39, Nick Rogers <email@hidden> 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+KeyPaths.h





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: multiple profiles in preferences mechanism
      • From: Nick Rogers <email@hidden>
References: 
 >multiple profiles in preferences mechanism (From: Nick Rogers <email@hidden>)

  • Prev by Date: Can Deactivation be Prevented When Launching Popover?
  • Next by Date: Re: multiple profiles in preferences mechanism
  • Previous by thread: multiple profiles in preferences mechanism
  • Next by thread: Re: multiple profiles in preferences mechanism
  • Index(es):
    • Date
    • Thread