Instance Method

initWithTarget:selector:object:

Returns an NSThread object initialized with the given arguments.

Declaration

- (instancetype)initWithTarget:(id)target selector:(SEL)selector object:(id)argument;

Parameters

target

The object to which the message specified by selector is sent.

selector

The selector for the message to send to target. This selector must take only one argument and must not have a return value.

argument

The single argument passed to the target. May be nil.

Return Value

An NSThread object initialized with the given arguments.

Discussion

The objects target and argument are retained during the execution of the detached thread. They are released when the thread finally exits.

See Also

Initializing an NSThread Object

- init

Returns an initialized NSThread object.

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