简体   繁体   English

关于线程+ iPhone的问题

[英]Question about Thread + iPhone

I am having a confusion with threads. 我对线程感到困惑。

Suppose I start a thread in a ViewController which is doing some heavy processing. 假设我在正在做一些繁重的处理的ViewController中启动了一个线程。 If I pop the viewController while the thread is still in execution will the thread stop executing or whether it will continue its execution. 如果我在线程仍在执行时弹出viewController,该线程将停止执行或将继续执行。

It will continue to run until it finishes or you make it stop. 它将继续运行,直到完成或停止为止。 So you should either kill that thread at an appropriate point, or make sure that the thread doesn't access any stale objects. 因此,您应该在适当的时候终止该线程,或者确保该线程不访问任何陈旧的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM