Re: newbie notification question.
Re: newbie notification question.
- Subject: Re: newbie notification question.
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 28 Mar 2002 23:18:00 -0800
On Thursday, March 28, 2002, at 08:59 AM, Greg Jackson wrote:
In the controller class I have the following code:
- (void) awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(controlTextDidChange:)
name:@"NSControlTextDidChange" object:nil];
}
Others have pointed out the spelling error.
I might note two other things:
(a) Again as someone else suggested, it might be easier if you set your
controller as the delegate of the text field it should be automatically
registered to receive the notification (you have to implement:
- (void)controlTextDidChange:(NSNotification *)aNotification
).
(b) If you want to use the "direct registration" technique, you may not
want to set the object argument to nil. Doing so will ensure you
receive the notification when *any* control's text changes, which may be
more often than you'd like...
mmalc
_______________________________________________
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.