Re: (RS)What's the type of a selector?[3]
Re: (RS)What's the type of a selector?[3]
- Subject: Re: (RS)What's the type of a selector?[3]
- From: Chris Suter <email@hidden>
- Date: Sat, 28 Oct 2006 14:28:47 +1000
Someone just pointed me at:
http://lists.apple.com/archives/Objc-language/2006/Aug/msg00020.html
Don't believe anything I say today!
I've filed a documentation bug.
- Chris
On 28/10/2006, at 2:15 PM, Chris Suter wrote:
Hi,
I just wrote an apology to Roland off-list.
I didn't realise that you could cast SEL's to char * but from
reading the docs. it appears you can. It was probably originally
intended that objc_selector be an opaque type but given it's now
documented that you can cast to char *, it's very unlikely it will
change.
Looks like I should go read some books. :-)
- Chris
On 28/10/2006, at 2:11 PM, Klaus Backert wrote:
Am 28.10.2006 um 05:05 schrieb Roland Silver:
On Oct 27, 2006, at 8:30 PM, Chris Suter wrote:
Hi,
Looks like you should read some C books.
It's a pointer to an structure.
It's not a char * and NSLog ("%s", @selector (foo)) will not
work as someone suggested earlier.
Either use %p for a pointer or use %s with sel_getName or use %@
and NSStringFromSelector.
This is all in the documentation and you really don't need us to
help you.
- Chris
Well, Chris...
Aaron Hillegass writes in the 2nd Edition of his Cocoa Programming
for Mac OS X in Chapter 3 "Objective-C / For the More Curious: How
Does Messageing Work?", p78f:
"The selector is of type SEL. Although, SEL is actually defined to
be char * ...".
With Cmd-doubleclick on any SEL in Xcode I find immediately:
typedef struct objc-selector *SEL
in the header objc.h
There is a little bit more info in the Objective-C runtime reference.
Cheers.
Klaus
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
systems.com
This email sent to email@hidden
--
Coriolis Systems Limited is a limited company incorporated in
England and Wales
Company No. 5061807 Registered Office: 10 Oxford Street,
Southampton, SO14 3DJ
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
systems.com
This email sent to email@hidden
--
Coriolis Systems Limited is a limited company incorporated in England
and Wales
Company No. 5061807 Registered Office: 10 Oxford Street,
Southampton, SO14 3DJ
_______________________________________________
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