performSelector(inBackground:with:)
Invokes a method of the receiver on a new background thread.
Declaration
func performSelector(inBackground aSelector: Selector, with arg: Any?)Parameters
- aSelector:
A TP40008195 CH48 that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments.
- arg:
The argument to pass to the method when it is invoked. Pass
nilif the method does not take an argument.
Discussion
This method creates a new thread in your application, putting your application into multithreaded mode if it was not already. The method represented by aSelector must set up the thread environment just as you would for any other new thread in your program. For more information about how to configure and run threads, see Threading Programming Guide.
See Also
Sending Messages
perform(_:with:afterDelay:)perform(_:with:afterDelay:inModes:)performSelector(onMainThread:with:waitUntilDone:)performSelector(onMainThread:with:waitUntilDone:modes:)perform(_:on:with:waitUntilDone:)perform(_:on:with:waitUntilDone:modes:)cancelPreviousPerformRequests(withTarget:)cancelPreviousPerformRequests(withTarget:selector:object:)