Re: Why use NSObjectController?
Re: Why use NSObjectController?
- Subject: Re: Why use NSObjectController?
- From: "Sean McBride" <email@hidden>
- Date: Mon, 11 Aug 2008 11:52:15 -0400
- Organization: Rogue Research
On 8/10/08 10:08 PM, Seth Willits said:
>>> What is it that NSObjectController offers me?
>>
>> An implementation of the NSEditor and NSEditorRegistration protocols.
>
>Now I'll just have to figure out when I'd want to use those...
I seem to have run into this situation the other day. Maybe my example
will help.
I have a nib with some textfields bound to an ivar in File's Owner. It
mostly works fine. Now I have a push button that reads those ivars and
performs some computation. If the user has typed something in the
textfield but not changed focus, this new value is not yet in the ivar.
Here the commitEditing method is your friend. But it seems you can't
send commitEditing to a textfield. (Yet the docs say "The NSEditor
informal protocol is implemented by controllers and user interface
elements. [...] These methods are typically invoked on user interface
elements"). I believe I'll need to change those textfields to be bound
to an NSController subclass.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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