• 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?[3]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: (RS)What's the type of a selector?[3]
  • From: Stephen Deken <email@hidden>
  • Date: Fri, 27 Oct 2006 23:00:52 -0500

Second: I'm sure there isn't a book on C that talks about @selector or NSLog, which are Cocoa features, not C features.

Actually, these are Objective C features. Cocoa is a set of classes built on top of Objective C.


Fourth: It doesn't look to me like @selector is a pointer to a struct (if that's what you meant), it looks like a pointer-to-char, i.e. a C-string.

I don't see it defined that way. objc.h:

	typedef struct objc_selector 	*SEL;

If it looks like a char*, that's an implementation detail that you should not rely on.

Fifth: Thanks for telling me that it's "all in the documentation" and I don't need the list members to help me. I searched around at length in the "documentation" before putting my question to the list, but didn't find the answer anywhere I looked.

<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ index.html>


Specifically:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ Articles/chapter_4_section_6.html>

Specifically:

"Selectors

"For efficiency, full ASCII names are not used as method selectors in compiled code. Instead, the compiler writes each method name into a table, then pairs the name with a unique identifier that represents the method at runtime."

So the fact that right now you can get away with casting them to a char* does not mean that it won't change in the future.

Finally, something about flies and vinegar versus honey. Please don't be rude to the people you're asking for help.

Stephen Deken
email@hidden
_______________________________________________
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>)
 >(RS)What's the type of a selector?[3] (From: Roland Silver <email@hidden>)

  • Prev by Date: (RS)What's the type of a selector?[3]
  • Next by Date: Re: (RS)What's the type of a selector?[3]
  • Previous by thread: (RS)What's the type of a selector?[3]
  • Next by thread: Re: (RS)What's the type of a selector?[3]
  • Index(es):
    • Date
    • Thread