20 minute presentation on using Apple's Grand Central Dispatch for multithreading iOS applications. This talk was given at LiDG by David Fox on the 6th of April 2011.
18. The NSOperationQueue Workflow
Subclasses of NSOperation are created
Typically they override -(void) main
An NSOperationQueue is created and
NSOperations are added to it
The queue is set in action and the operations
are executed
Queues may be suspended so operations must
be aware of this
19. Operation Queues In Action
Simple Asynchronous Operations
Note: As OperationA and OperationB are running on the
same queue, operations won’t necessarily finish in the
order they’re added.
21. Operation Queues In Action
Waiting Until An Operation Queue Is Complete Before Continuing
22. Cancelling An Entire Queue
NSOperationQueues offer a
cancelAllOperations method
All the NSOperations will be notified of this
They can choose to perform certain actions
based upon their isCancelled property
Individual operations can be cancelled using
cancel
23. Loads More To Explore
Blocks instead of delegates
Dispatch Resources
Concurrent Operations
Semaphores
Delayed dispatches
Check The Apple Documentation