NSTimer 运行 发起的方法在什么线程上?
On what thread does a method initiated by NSTimer run on?
当方法 aMethod
运行s 作为 NSTimer 的结果时,如下所示:
NSTimer* theTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0
target: self
selector: @selector(aMethod:)
userInfo: nil
repeats: YES];
aMethod
运行 是在调用 theTimer
的线程(主线程)上,还是在单独的线程上?另外,NSTimer 是在 aMethod
处于 运行ning 时继续重复,还是等到 aMethod
完成?
NSTimer
在调度计时器的线程上调用在 selector:
参数中传递的选择器。这可能是也可能不是主线程。
当方法 aMethod
运行s 作为 NSTimer 的结果时,如下所示:
NSTimer* theTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0
target: self
selector: @selector(aMethod:)
userInfo: nil
repeats: YES];
aMethod
运行 是在调用 theTimer
的线程(主线程)上,还是在单独的线程上?另外,NSTimer 是在 aMethod
处于 运行ning 时继续重复,还是等到 aMethod
完成?
NSTimer
在调度计时器的线程上调用在 selector:
参数中传递的选择器。这可能是也可能不是主线程。