• 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: Inter-class Dependent Keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inter-class Dependent Keys


  • Subject: Re: Inter-class Dependent Keys
  • From: Jonathon Mah <email@hidden>
  • Date: Sun, 6 Mar 2005 04:38:31 +1030

On 6 Mar 2005, at 01:54, Ricky Sharp wrote:
Going back to the problem at hand, I'd think about changing your UI to offer both a "Next" and an "Add" button. The enabled states are then bound to an appropriate controller key. In this situation, you avoid having a single button whose use/title is overloaded.

Yes, I don't like the UI, but I was wondering how to do it anyway. Pretend I have a button next to a TableView (which allows multiple selection), whose title is "Delete %d Rows".


However, if you cannot do this, what you could do I suppose is to bind the button's title to 'canSelectNext' and use a value transformer to generate the appropriate string based on the boolean value.

I guess a value transformer is the best way to do it in this case (button title), but I can imagine other cases where value transformers would not work (e.g. for fullName, if firstName and lastName were in a different object).



On 6 Mar 2005, at 01:45, glenn andreas wrote:
You could also register for the changes in the first object, and then say [secondObject will/didChangeValueForKey: @"fullName"].

This is what I'm doing at the moment. The problem with this approach is that 'willChangeValueForKey:' is called _after_ the value has been changed, so if another object observes fullName, registering to receive both old and new values, they will instead get the new value for both cases.


Thanks for the help,


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: 
 >Inter-class Dependent Keys (From: Jonathon Mah <email@hidden>)
 >Re: Inter-class Dependent Keys (From: Ricky Sharp <email@hidden>)
 >Re: Inter-class Dependent Keys (From: Jonathon Mah <email@hidden>)
 >Re: Inter-class Dependent Keys (From: Ricky Sharp <email@hidden>)

  • Prev by Date: How to make key shortcuts and mouse click trigger controlTextDidEndEditing:
  • Next by Date: Re: Problems rotating an NSImage
  • Previous by thread: Re: Inter-class Dependent Keys
  • Next by thread: Re: Inter-class Dependent Keys
  • Index(es):
    • Date
    • Thread