• 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: Shawn Erickson <email@hidden>
  • Date: Sun, 21 Sep 2003 11:59:33 -0700

On Sunday, September 21, 2003, at 11:27 AM, 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?

You can use any name for you selector that you want. The observer you add obviously has to have a method by that name for things to work.

Try reading the online docs (all found in a few click from Apple website)...

http://developer.apple.com/documentation/Cocoa/Conceptual/ CommunicateWithObjects/Articles/Notifications.html#//apple_ref/doc/uid/ 20001925

and

http://developer.apple.com/documentation/Cocoa/Conceptual/ Notifications/index.html#//apple_ref/doc/uid/10000043i

and

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSNotification.html#//apple_ref/occ/cl/ NSNotification

-Shawn
_______________________________________________
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: notifications questions
  • Next by Date: Re: Using a String Object in another class
  • Previous by thread: notifications questions
  • Next by thread: Re: notifications questions
  • Index(es):
    • Date
    • Thread