Type Alias

SEL

Defines an opaque type that represents a method selector.

Declaration

typedef struct objc_selector *SEL;

Discussion

Method selectors are used to represent the name of a method at runtime. A method selector is a C string that has been registered (or “mapped“) with the Objective-C runtime. Selectors generated by the compiler are automatically mapped by the runtime when the class is loaded.

You can add new selectors at runtime and retrieve existing selectors using the function sel_registerName.

When using selectors, you must use the value returned from sel_registerName or the Objective-C compiler directive @selector(). You cannot simply cast a C string to SEL.

See Also

Class-Definition Data Structures

Class

An opaque type that represents an Objective-C class.

Method

An opaque type that represents a method in a class definition.

Ivar

An opaque type that represents an instance variable.

Category

An opaque type that represents a category.

objc_property_t

An opaque type that represents an Objective-C declared property.

IMP

A pointer to the start of a method implementation.

objc_method_description

Defines an Objective-C method.

objc_cache

Performance optimization for method calls. Contains pointers to recently used methods.

objc_property_attribute_t

Defines a property attribute.