Creates and executes a new thread based on the specified target and selector.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
+ (void)detachDrawingThread:(SEL)selector toTarget:(id)target withObject:(id)argument;
Parameters
selector
The selector whose code you want to execute in the new thread.
target
The object that defines the specified selector.
argument
An optional argument you want to pass to the selector.
Discussion
This method is a convenience wrapper for the detach
method of NSThread
. This method automatically creates an @autoreleasepool
block for the new thread before invoking selector
.