Re: Manually updating a data bound value of a bound text field
Re: Manually updating a data bound value of a bound text field
- Subject: Re: Manually updating a data bound value of a bound text field
- From: Ramakrishna Vavilala <email@hidden>
- Date: Thu, 18 Jun 2009 09:39:27 -0700
That works well.
I eventually implemented
- (void)objectDidBeginEditing:(id)editor
and
- (void)objectDidEndEditing:(id)editor
It works like a charm. I agree that the better design would be to use
an object controller. But I was also trying to understand how the
whole binding thing works so it is good to know about
NSEditorRegistration.
Thanks for your help:).
On Thu, Jun 18, 2009 at 9:33 AM, Ken Thomases<email@hidden> wrote:
> On Jun 18, 2009, at 11:17 AM, Ramakrishna Vavilala wrote:
>
>> Unfortunately, I used incorrect design by binding text field to
>> properties of the file's owner (which happens to be a
>> NWindowController) which does not respond to commitEditing message.
>> Any other ideas?
>
> Fix the design? It should be relatively easy to interpose an
> NSObjectController in between and adjust your bindings.
>
> Alternatively, you can directly invoke one of the commitEditing... methods
> on the text field, but you should only invoke it if you know that the text
> field is editing. To learn that, you'd have to make the bound-to object
> (File's Owner) conform to NSEditorRegistration so that the text field (and
> any other editors) can inform it when it's editing. This is essentially
> re-implementing a part of what NSController-derived classes would do for
> you. That seems like a lot of unnecessary work to me.
>
> Regards,
> Ken
>
>
_______________________________________________
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