• 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: Altering the behavior of NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Altering the behavior of NSUserDefaults


  • Subject: Re: Altering the behavior of NSUserDefaults
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 06 Oct 2006 17:07:00 -0700
  • Thread-topic: Altering the behavior of NSUserDefaults

On Fri, 6 Oct 2006 16:41:15 -0700, Ron Aldrich <email@hidden> said:
>Folks,
>
>I've run into a bit of a problem, which I'm unsure how to address.
>
>I'm implementing a preferences panel in my application, with the view
>objects bound to an NSUserDefaultsController.
>
>Many of the bindings need to be handled programatically - for
>instance, the "enabled" bindings depend on the value of some of the
>other settings.
>
>The problem is, I can't figure out how, or where, I'm supposed to
>instantiate my subclass of NSUserDefaults (or of
>NSUserDefaultsController, for that matter).
>
>I tried setting the NSUserDefaultsController's custom class attribute
>in Interface Builder, but it seems to be ignored, when creating
>controllers (Is this a bug in IB? or am I not supposed to be
>overriding the behavior of controllers?)
>
>I also tried setting a delegate for NSUserDefaults, but that doesn't
>appear to be supported.
>
>Any suggestions?

What I would do is to bind stuff in the preferences panel to a custom class,
and bind the stuff in the custom class to the NSUserDefaults. That way,
there is no need for a subclass of NSUserDefaults; the functionality you're
looking for would be handled by the intermediate class. Binding "chains" of
this sort are quite common in my apps, because I often have three (or more)
things to keep in synch. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Mini controls
  • Next by Date: Re: Mini controls
  • Previous by thread: Altering the behavior of NSUserDefaults
  • Next by thread: Re: Altering the behavior of NSUserDefaults
  • Index(es):
    • Date
    • Thread