Serial Operations

Visit the sample app, and select the row called Operation Queue-Serial. The five initial items in the table view are visible, and they are scrollable while the long-running tasks are being processed (view the debugging console to confirm that they are being processed while scrolling the table view). After the tasks are completed, the additional rows become visible.

The setups of the initial data and operation queue are identical to the Operation Queue-Concurrent approach. To have the operations process serially in the correct order, they need to be set up with dependencies. To accomplish this task, the viewDidAppear: method adds an array to store the operations as they are created, and an NSInvocationOperation (prevOperation ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.