Selector

"Selector" is also a: user

created by Webster 1913
(thing) by mcc (2.7 y) (print)   ?   (I like it!) Thu Mar 01 2001 at 6:20:28
In Objective C, a Selector is a run-time value of type SEL (see SEL) that serves as a kind of an identification number for a method. The run-time system is responsible for ensuring that each method that could be called has a unique and nonzero selector, and the Objective C messaging system, while it is trying to figure out what to do with a method call, uses these selectors to refer to methods.

The @selector( methodname ) directive will return the selector of methodname. Methodname should be given name only-- for example '- thingWithWidth:(int)w AndName: (NSString)bdf AndOtherThing: ktru' would be reduced to just @selector( thingWithWidth:AndName:AndOtherThing: ).

Uses for the resulting product include the (BOOL)respondsToSelector:(SEL)selector method-- which, as part of NSObject is supported by literally every objective c object-- and calling objc_msgSend() by hand, if for some completely bizarre reason you absolutely HAVE to do that. Keep in mind, though, that in any situation you might be tempted to call objc_msgSend() by hand, you would be better off using the PerformSelector: method (which is also inherited from NSObject) instead.

(definition) by Webster 1913 (print) 1 C! Wed Dec 22 1999 at 2:59:34

Se*lect"or (?), n. [L.]

One who selects.

 

© Webster 1913.

Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.