• 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: (RS)What's the type of a selector?[2]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (RS)What's the type of a selector?[2]


  • Subject: Re: (RS)What's the type of a selector?[2]
  • From: Uli Kusterer <email@hidden>
  • Date: Sun, 29 Oct 2006 12:17:32 +0100

Am 28.10.2006 um 04:30 schrieb Chris Suter:
Looks like you should read some C books.

All of us should do that, actually. It's never a bad idea to learn more.


It's a pointer to an structure.

It's not a char * and NSLog ("%s", @selector (foo)) will not work as someone suggested earlier.

Have you actually tried that?

Because if you had, you would have found that Spephan was completely correct. A SEL is, or at least starts with, a "uniqued" C string pointer. So, you can actually typecast it to a string and it will just work. Of course, that's making a lot of assumptions, and I would recommend the NSStringFromSelector() or sel_getName() approach because they're both documented and safer.

_cmd is an invisible first parameter passed to every ObjC method that contains the current method's SEL.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >What's the type of a selector? (From: Roland Silver <email@hidden>)
 >Re: What's the type of a selector? (From: John Stiles <email@hidden>)
 >(RS)What's the type of a selector?[2] (From: Roland Silver <email@hidden>)
 >Re: (RS)What's the type of a selector?[2] (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: drawRect troubles
  • Next by Date: Re: path vs. filename..
  • Previous by thread: Re: (RS)What's the type of a selector?[3]
  • Next by thread: Re: (RS)What's the type of a selector?[2]
  • Index(es):
    • Date
    • Thread