Re: Need clarification on categories
Re: Need clarification on categories
- Subject: Re: Need clarification on categories
- From: Matt Rollefson <email@hidden>
- Date: Thu, 21 Mar 2002 11:48:55 -0800
On Tuesday, March 19, 2002, at 11:18 AM, Erik M. Buck wrote:
The reason I'm suffering feelings of doubt is that the method I'm
trying
to
implement in a category is a delegate method, and it doesn't get called
when
I think it should. Specifically, the NSControl class reference document
says
the controlDidBeginEditing: delegate method will be called whenever a
text-based field is edited in any control that implements the method.
But
when I implement the method in a category on NSControl, it doesn't get
called. For example, I click into a field in an NSForm and type a
character,
but controlDidBeginEditing: doesn't get called.
I think the documentation lies. It might get called if you make the
control
its own delegate.
Please check the documentation before saying it lies -- we do our best
to keep it accurate. The documentation for controlTextDidBeginEditing:
(the actual name of the method; there is no controlDidBeginEditing:
method) is this:
controlTextDidBeginEditing:
- (void)controlTextDidBeginEditing:(NSNotification *)aNotification
Sent by the default notification center to the delegate and all
observers of the notification when a control with editable cells (such
as a text field, form field, or an NSMatrix) begins editing text. The
name of the notification (aNotification) is always
NSControlTextDidBeginEditingNotification. Use the key @"NSFieldEditor"
to obtain the field editor from aNotification's userInfo dictionary. If
the delegate implements this method, it's automatically registered to
receive this notification.
If you have reason to believe this information (or any other Cocoa
reference documentation, for that matter) is incorrect, please file a
bug, and we'll correct it as soon as possible.
Matt Rollefson (Rollie)
Manager: Cocoa & Developer Tools
Technical Publications
Apple Computer, Inc.
_______________________________________________
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.