Re: NSTextFieldCell Action Method Not Reaching Delegate?
Re: NSTextFieldCell Action Method Not Reaching Delegate?
- Subject: Re: NSTextFieldCell Action Method Not Reaching Delegate?
- From: Kyle Sluder <email@hidden>
- Date: Mon, 11 Jul 2011 20:56:12 -0700
On Sat, Jul 9, 2011 at 1:14 AM, Vik Rubenfeld <email@hidden> wrote:
> I have an NSOutlineView with five columns. I need to know which column contains the NSTextFieldCell which is currently being edited. To do that, I thought I would connect the action method of the NSTextFieldCell to a method in the NSOutlineView's delegate, which could check the Tag of the NSTextField, to determine what column that field was in. However, the action method I set up in the delegate, is never called.
>
> Question 1) Is there a better way to do this?
I guess the question is, when do you need to know what column is being
edited? It sounds like you're trying to figure this out when the user
presses Return or otherwise confirms their changes to the field
editor.
The typical (slightly historical) way to do this is to implement
-controlTextDidEndEditing: in your outline view's delegate, and ask
for its -editedRow and -editedColumn at that time. Be sure to heed the
warning in the -controlTextDidEndEditing: documentation that this
method may get called even if the user hasn't made any changes.
Or, you could use bindings, and perhaps avoid needing to know the
row/column being edited in the first place.
--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