NSThread(BMKitAdditions) Category Reference
Declared in | NSThread+BMKitAdditions.h |
Tasks
Initializing an NSThread Object
-
– initWithBlock:
Returns an
NSThread
object initialized with the given arguments.
Starting a Thread
-
+ detachNewThreadBlock:
Detaches a new thread and uses the specified block as the thread entry point.
Class Methods
detachNewThreadBlock:
Detaches a new thread and uses the specified block as the thread entry point.
+ (void)detachNewThreadBlock:(BMBlock)aBlock
Parameters
- aBlock
The block to execute.
Discussion
In contrast to the detachNewThreadSelector:toTarget:withObject:
class method of the NSThread
class, you do not need to set up an autorelease pool for the block in a non garbage-collected environment. This is done automatically.
The block aBlock is copied, and released when the thread finally exits. The detached thread is exited (using the exit
class method of the NSThread
class) as soon as aBlock has completed executing.
If this thread is the first thread detached in the application, this method posts the NSWillBecomeMultiThreadedNotification
with object nil
to the default notification center.
See Also
Declared In
NSThread+BMKitAdditions.h
Instance Methods
initWithBlock:
Returns an NSThread
object initialized with the given arguments.
- (id)initWithBlock:(BMBlock)aBlock
Parameters
- aBlock
The block to execute.
Return Value
An NSThread object initialized with the given arguments.
Discussion
In contrast to the initWithTarget:selector:object:
instance method of the NSThread
class, you do not need to set up an autorelease pool for the block in a non garbage-collected environment. This is done automatically.
The block aBlock is copied, and released when the thread finally exits.
See Also
Declared In
NSThread+BMKitAdditions.h