Re: (RS)What's the type of a selector?[2]
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