• 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: bindings + actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bindings + actions


  • Subject: Re: bindings + actions
  • From: Jonathon Mah <email@hidden>
  • Date: Sun, 21 May 2006 23:34:29 +0930

Hi Justin,

On 2006-05-21, at 23:01, Justin R. Miller wrote:

I have implemented bindings for some NSUserDefaults settings, but some of the UI actions need to trigger events as well. For example, not only do I want to toggle the user default BOOL, but I would like to engage or disengage something at the same time.

I have found that binding the UI element as well as giving it a target and action in IB does the trick. Is this the proper way to do things?

I would recommend observing user defaults in your controller; either by binding a controller key to the user defaults, or by using KVO directly [userDefaults addObserver:...]. As you also mention, you can listen on a notification, but I prefer using KVO since it will work with all objects (regardless of whether they post a notification).




Jonathon Mah
email@hidden


_______________________________________________ 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
References: 
 >bindings + actions (From: "Justin R. Miller" <email@hidden>)

  • Prev by Date: Programatically setting relationship [<-->>] results in two objects in table
  • Next by Date: Re: core data, synchonizing multiple MOC's
  • Previous by thread: bindings + actions
  • Next by thread: Stop NSTableColumn from being dragged, and from changing position (like iTunes)
  • Index(es):
    • Date
    • Thread