开发者

NsThread list task

Hello everyone I need to accomplish this (iphone/objective-c) :

  • I have my thread it has to pe开发者_JAVA技巧rform the operations.
  • the main thread assigns a new task to my thread (the tasks are always the same).
  • each operation has its own id.
  • the main thread when assigning a task to my thread, must check whether this operation is an operation that could stop (cancel) that is running on my thread (if new task id = task running id).

  • Do you have any suggestions on how I might accomplish this?

  • for this work...NSThread or NSOperation?
  • I need a shared data structure and synchronized to the operations?
  • how can I handle the abort the transaction without having to kill the thread? Thanks


Take a look at NSOperation and NSOperationQueue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜