NSOperation on the iPhone

Coocoo4Cocoa picture Coocoo4Cocoa · May 6, 2009 · Viewed 43.1k times · Source

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 wrapper around writing your own threaded code. I haven't seen any Apple demo apps using it, and I'm wondering if I'm missing out on a great tool instead of using NSThread.

The ideal solution here would be to describe a use-case scenario for NSOperation and how you would use it to solve your problem(s).

Answer

e.James picture e.James · May 6, 2009

Cocoa Is My Girlfriend has a good tutorial on the use of NSOperation and NSOperationQueue. The tutorial makes use of NSOperation to download several webpages simultaneously in separate threads.

Also, see this article from Mac Research.