• 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
Subclassing NSUserDefaultsController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassing NSUserDefaultsController


  • Subject: Subclassing NSUserDefaultsController
  • From: Thomas Bauer <email@hidden>
  • Date: Sun, 20 Sep 2009 21:39:54 +1200

Dear List,

In some cases my application needs to modify and get the user defaults from a different user than the one it is launched under.
Since this affects not only things done programmatically, but also parts of the user interface that use bindings,
I was thinking an elegant solution would be to make the SharedDefaults controller be a subclass and
override the designated init method to either be initialized by sharedDefaults or a NSDefaults object created with initWithUser.
Unfortunately this does not seem to work on a basic level.


Even though I have assigned a custom NSUserDefaultsController subclass to the Shared Defaults object in interface builder,
the designated initializer


- (id)initWithDefaults:(NSUserDefaults *)defaults initialValues: (NSDictionary *)initialValues

is never called.

Any suggestions on why that is or if there is another maybe better way to accomplish operating on a different users defaults domain would be appreciated.

Thanks and regards
Thomas


_______________________________________________

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: Subclassing NSUserDefaultsController
      • From: James Bucanek <email@hidden>
    • Re: Subclassing NSUserDefaultsController
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Push-on push-off buttons doesn't show state
  • Next by Date: Re: Running run loops in 10.6 (was: Need -[NSTask waitUntilExitOrTimeout:])
  • Previous by thread: Re: NSTextField black outline, not drawing in background thread when in a custom NSControl?
  • Next by thread: Re: Subclassing NSUserDefaultsController
  • Index(es):
    • Date
    • Thread