NSObject(SFBlocks) Category Reference
Declared in | NSObject+SFBlocks.h |
---|
– performBlock:onThread:waitUntilDone:
Perform a block on a specific thread.
- (void)performBlock:(SFThreadBlock)block onThread:(NSThread *)thread waitUntilDone:(BOOL)waitUntilDone
Parameters
block |
The block to execute on the thread |
---|---|
thread |
The thread in which to execute the block |
waitUntilDone |
Flag that indicates if this method should block until the block is done executing |
Declared In
NSObject+SFBlocks.h
– performBlockOnGlobalQueue:afterDelay:
Perform a block on a global queue thread after a delay.
- (void)performBlockOnGlobalQueue:(SFThreadBlock)block afterDelay:(NSTimeInterval)delay
Parameters
block |
The block to execute |
---|---|
delay |
The delay before executing the block |
Declared In
NSObject+SFBlocks.h
– performBlockOnMainThread:afterDelay:
Perform a block on the main thread after a delay.
- (void)performBlockOnMainThread:(SFThreadBlock)block afterDelay:(NSTimeInterval)delay
Parameters
block |
The block to execute |
---|---|
delay |
The delay before executing the block |
Declared In
NSObject+SFBlocks.h
– waitForBlockCondition:timeout:
Wait until a block return value is YES or a time-out happens.
- (BOOL)waitForBlockCondition:(BOOL ( ^ ) ( void ))block timeout:(NSTimeInterval)duration
Parameters
block |
The block that will be invoked regularily until it returns YES or a time-out happen. |
---|---|
duration |
Time-out duration. |
Return Value
YES if the block returned YES or NO if a time-out happened
Declared In
NSObject+SFBlocks.h
– synchronouslyExecuteBlockOnMainThread:
Executes the given block directly if called from the main thread. Otherwise the block is synchronously dispatched for execution on the main thread.
- (void)synchronouslyExecuteBlockOnMainThread:(void ( ^ ) ( void ))block
Parameters
block |
The block to execute |
---|
Declared In
NSObject+SFBlocks.h
– asynchronouslyExecuteBlockOnMainThread:
The block is asynchronously dispatched for execution on the main thread.
- (void)asynchronouslyExecuteBlockOnMainThread:(void ( ^ ) ( void ))block
Parameters
block |
The block to execute |
---|
Declared In
NSObject+SFBlocks.h
– executeBlockOrDispatchIfNotMainThread:
Executes the given block directly if called from the main thread. Otherwise the block is asynchronously dispatched for execution on the main thread.
- (void)executeBlockOrDispatchIfNotMainThread:(void ( ^ ) ( void ))block
Parameters
block |
The block to execute |
---|
Declared In
NSObject+SFBlocks.h