Here are the key points about the @selector directive in Objective-C:
- @selector is used to specify a selector, which identifies a method by name at runtime.
- Selectors are used when sending messages between objects dynamically, such as with performSelector:.
- A selector is essentially a string representation of a method name.
- To define a selector constant, use @selector(methodName). This returns an SEL data type.
- Selectors allow late binding of method calls. The exact method implementation is looked up at runtime based on the class of the receiving object.
- Common uses of selectors include target-action patterns in UIKit and performing delayed messages with performSelector:.