Custom Operations

Return to the sample app, and select the row called Operation Queue-Custom. The five initial items in the table view are visible, and they are scrollable while the long-running tasks are being processed (view the debuggving console to confirm that they are being processed while scrolling the table view). Quickly hit the Cancel button at the top of the table before the operations complete. Notice that this time the tasks stop immediately.

The setups of the initial data and operation queue are nearly identical to the Operation Queue-Serial approach. The only difference is the use of a custom NSOperation subclass called ICFCustomOperation:

- (void)viewDidAppear:(BOOL)animated{    [super viewDidAppear:animated ...

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.