• 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: Bidirectional, Manual Binding in custom control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bidirectional, Manual Binding in custom control


  • Subject: Re: Bidirectional, Manual Binding in custom control
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 28 Jun 2012 10:49:17 -0700

On 2012 Jun 27, at 22:42, Quincey Morris wrote:

> the setter should only contain the second part ("Set ivar, needsDisplay").
>
> It seems to me this should prevent selection changes from rebounding onto the data model.

Yes.

> Using mouseDown kinda feels wrong to me. Wouldn't it make more sense to do the first part of the existing code ("Stuff to make reverse binding work") in an action method?
>
>> - (IBAction) changeRating: (sender) { …
>
> That way you're not dependent on *how* the control gets a new value.

OK, but effectively this means that I simply factor this -changeRating: action method out of my -mouseDown: method.  Only -mouseDown: will invoke -changeRating: at this time.

I don't think I've ever seen a control class implementing an action method, but I suppose that factoring as you suggest is a good practice to avoid bugs being introduced during future changes.


_______________________________________________

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: Bidirectional, Manual Binding in custom control
      • From: Quincey Morris <email@hidden>
References: 
 >Re: Bidirectional, Manual Binding in custom control (From: Jerry Krinock <email@hidden>)
 >Re: Bidirectional, Manual Binding in custom control (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Transparent NSTextField
  • Next by Date: Re: Bidirectional, Manual Binding in custom control
  • Previous by thread: Re: Bidirectional, Manual Binding in custom control
  • Next by thread: Re: Bidirectional, Manual Binding in custom control
  • Index(es):
    • Date
    • Thread