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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]