Re: Ending Editing when Doc Saves?
Re: Ending Editing when Doc Saves?
- Subject: Re: Ending Editing when Doc Saves?
- From: "Kyle Sluder" <email@hidden>
- Date: Thu, 29 May 2008 09:17:22 -0400
On Wed, May 28, 2008 at 11:15 PM, David Carlisle
<email@hidden> wrote:
> If I'm adding text to an NSTextField, then I select Save, somehow the
> message needs to get to the NSTextField wherever it is that it needs to
> terminate editing and send its contents to the model before the model is
> saved. I don't see how I should go about implementing that? Any
> suggestions are welcome.
Take a look at the NSEditorRegistration informal protocol. This is
what Cocoa Bindings uses to implement exactly what you're seeking.
It's also why Apple strongly suggests you do not bind from your views
straight to your model, but instead go through an NSController.
--Kyle Sluder
_______________________________________________
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