Function

sel_registerName(_:)

Registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value.

Declaration

func sel_registerName(_ str: UnsafePointer<Int8>) -> Selector

Parameters

str

A pointer to a C string. Pass the name of the method you wish to register.

Return Value

A pointer of type SEL specifying the selector for the named method.

Discussion

You must register a method name with the Objective-C runtime system to obtain the method’s selector before you can add the method to a class definition. If the method name has already been registered, this function simply returns the selector.

See Also

Working with Selectors

func sel_getName(Selector) -> UnsafePointer<Int8>

Returns the name of the method specified by a given selector.

func sel_getUid(UnsafePointer<Int8>) -> Selector

Registers a method name with the Objective-C runtime system.

func sel_isEqual(Selector, Selector) -> Bool

Returns a Boolean value that indicates whether two selectors are equal.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software