iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
Summary
This chapter introduced several techniques to process long-running tasks without interfering with the UI, including performSelectorInBackground:withObject:, operation queues, and Grand Central Dispatch queues.
Using the performSelectorInBackground:withObject: method on NSObject to execute a task in the background is the simplest approach, but provides the least support and management.
Operation queues can process tasks concurrently or serially, using a method call, a block, or a custom operation class. Operation queues can be managed by specifying a maximum number of concurrent operations, they can be suspended and resumed, and all the outstanding operations can be canceled. Operation queues can handle custom operation classes. Operation ...
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