Re: Triggering NSTextView changes and bindings
Re: Triggering NSTextView changes and bindings
- Subject: Re: Triggering NSTextView changes and bindings
- From: Michael Ash <email@hidden>
- Date: Sun, 1 Feb 2009 12:24:37 -0500
On Sun, Feb 1, 2009 at 11:45 AM, Chris Idou <email@hidden> wrote:
> I've got an NSTextView whose attributeValue is bound to a core-data object.
>
> I've got a menu item which programmatically modifies the NSTextView's contents.
>
> The programmatic changes don't trigger a modification to the underlying object unless the user tabs to and exits the NSTextView manually.
>
> What is the correct way, when programmatically modifying an NSTextView, to make sure the system propagates changes to underlying bindings?
The correct way is not to do it in the first place.
Views are there for the user to modify, not for your program to
modify. Bindings are two-directional: your program should change the
*model*, and then the binding will ensure that the NSTextView matches
that change.
Mike
_______________________________________________
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