• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: notifications questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >notifications questions (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: RE: Using NSArchiver with NSDocument follow-up
  • Next by Date: NSImage initialized with EPS file is nil
  • Previous by thread: Re: notifications questions
  • Next by thread: IB problem
  • Index(es):
    • Date
    • Thread