I\'ve been looking for some concrete scenarios for when NSOperation
on the iPhone is an ideal tool to use in an application. To my understanding, this is a wrap
In a word: NSOperationQueue
NSOperationQueue
is thread safe (you can add operations to it from different threads without the need for locks) and enables you to chain NSOp objects together.
My Flickr iPhone app, Reflections, uses NSOperation
and NSOperationQueue
extensively to manage downloading images and XML
.
Caveat: Make sure you read, re-read, and understand what the docs mean when they talk about 'concurrency'.