iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access