Re: notifications questions
Re: notifications questions
- Subject: Re: notifications questions
- From: David Remahl <email@hidden>
- Date: Sun, 21 Sep 2003 23:06:05 +0200
On 2003-09-21, at 20.27, Theodore Petrosky wrote:
I am looking for a deeper understanding of syntax for
notifications.
[[NSNotificationCenter defaultCenter] addObserver:
self selector: @selector(cellTextDidEndEditing:) name:
NSControlTextDidEndEditingNotification object:
njProjectCodeComboBox];
My question is about the @selector. does is have to be
cellTextDidEndEditing:? Can I create a selector
mySelector: for this object?
Ted
No, the selector is the name of the message you want the observer to
receive when the notification is posted. It can be whatever you want it
to be. If it takes an argument (ends with a colon), then the
notification object is passed as the first argument.
If you use @selector(mySelector:), then you should also create a method
on the observer (self):
- (void)mySelector:(NSNotification *)notif {
// whatever
}
/ Rgds, David
_______________________________________________
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.