Re: End Editing with RETURN
Re: End Editing with RETURN
- Subject: Re: End Editing with RETURN
- From: Greg Titus <email@hidden>
- Date: Thu, 5 Jun 2003 15:42:22 -0700
On Thursday, June 5, 2003, at 03:12 PM, Bill Cheeseman wrote:
Greg, I can't find this in any documentation except for the NSText
version
of -textDidEndEditing:. The documentation for the NSTextField version
of
-textDidEndEditing: only refers to an NSFieldEditor key.
Are you saying that NSTextField's version of this delegate method
responds
both to the NSTextMovement key and the NSFieldEditor key in its
userInfo?
NSTextField does not inherit from NSText, although I realize that
there is a
close relationship. Given the lack of an inheritance relationship, I
would
think the documentation for NSTextField should mention this key, if
this is
correct.
I ask, because I don't have time to test it just now.
The documentation on NSText has a delegate message / notification named
-textDidEndEditing:.
On the other hand, the documentation for that method on NSTextField is
talking about an _implementation_ that handles an end of editing
notification. On the third hand, the documentation you are looking at
that has an "NSFieldEditor" key is -controlTextDidEndEditing:, a
different notification altogether.
So an NSTextField uses a field editor to edit the text. This field
editor is an NSText. The field sets itself as the delegate of the text,
therefore receiving the -textDidEndEditing: notification. The field
uses this notification both to do its own end editing processing, and
also to pass along its own -controlTextDidEndEditing: notification.
The original question was from someone who was subclassing NSTextField,
which is the delegate of the NSText, therefore it is the NSText's
notification that we were interested in. (By the way, I forgot to
mention that he really needs to call the superclass implementation in
his override of -textDidEndEditing:. Not calling it is why he is not
getting the text field's target and action invoked.)
Hope this helps,
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.