NSOperation on the iPhone

前端 未结 7 615
攒了一身酷
攒了一身酷 2020-11-28 19:54

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

相关标签:
7条回答
  • 2020-11-28 20:27

    I use it for asynchronous processing. It is the best way to get data from web services or to coordinate actions that take significant time to run. Because they are thread safe, asynchronous (doesn't tie up the main thread) and they support dependencies, they are a really great tool for your toolset.

    Dependencies allow you to make several separate operations and make sure the execute and succeed or error out in a certain order. This is really great when you need to synchronize a bunch of data but you need parent objects to sync before syncing child objects.

    0 讨论(0)
提交回复
热议问题