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

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


  • Subject: (RS)What's the type of a selector?[3]
  • From: Roland Silver <email@hidden>
  • Date: Fri, 27 Oct 2006 21:05:45 -0600

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... First: I've read Kernighan/Ritchie and Harbison/Steele; will they do?

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

Third, NSLog ("%s", @selector (foo)) DOES work, as Aaron Hillegass suggested: try it for yourself; I did! Here ya go:

@implementation type
- (void)awakeFromNib {
	NSLog(@"%s", @selector(awakeFromNib));
}
@end

That is the important part of a project that compiles and runs. The result from the run log is:

[Session started at 2006-10-27 20:46:42 -0600.]
2006-10-27 20:46:43.246 selectorType[1489] awakeFromNib

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.

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.

--Roland Silver <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


  • Follow-Ups:
    • Re: (RS)What's the type of a selector?[3]
      • From: PGM <email@hidden>
    • Re: (RS)What's the type of a selector?[3]
      • From: "Adam R. Maxwell" <email@hidden>
    • Re: (RS)What's the type of a selector?[3]
      • From: Klaus Backert <email@hidden>
    • Re: (RS)What's the type of a selector?[3]
      • From: Stephen Deken <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: KVC and Bindings Question
  • Next by Date: Re: (RS)What's the type of a selector?[3]
  • Previous by thread: Re: (RS)What's the type of a selector?[2]
  • Next by thread: Re: (RS)What's the type of a selector?[3]
  • Index(es):
    • Date
    • Thread