开发者

(iphone) canceling thread of performSelectorInBackground

I'm calling a function in another thread using performSelectorInBackground.

I'd like a "canceling" ability on the thread.

The selector is modifying a data, and canceling needs to maintain the data's integrity.

Main integrity on UIImages related operation, canceling the thread shouldn't leave UIImages corrupt开发者_如何学Goed.

I can think of setting a boolean value, and the selector to check the bool value from time to time so that it can terminate the operation gracefully and inform the main thread of completion of terminating.

Is there something I can use to this end or am I onto implementing this on my own?

Thank you


I can think of setting a boolean value, and the selector to check the bool value from time to time so that it can terminate the operation gracefully and inform the main thread of completion of terminating.

That's exactly how you have to do it.

Is there something I can use to this end or am I onto implementing this on my own?

You have to do this manually.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜