Re: about @selector
Re: about @selector
- Subject: Re: about @selector
- From: Andy Lee <email@hidden>
- Date: Thu, 9 May 2002 18:50:10 -0400
At 6:24 PM -0400 5/9/02, Antonio Inojal wrote:
But what does @selector(drawAnother:) do? In specific what is the
@selector used for?
The Objective-C compiler translates method names into unique numbers
called selectors. Manipulating these numbers at runtime is a lot
more efficient than dispatching messages via actual strings
containing their name.
The expression "@selector(drawAnother:)" translates to "the unique
number (i.e., selector) corresponding to the method name
'drawAnother:'." The datatype of the expression is SEL, which is
typedef'ed somewhere in the low-level Objective-C headers.
The language docs on Objective-C, under /Documentation, no doubt
explain this better than I just did. I think @selector is
technically a "compiler directive."
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.