1

我很想知道你是否可以为 iphone sdk 循环一个 NSThread。我了解到,我可以使用 NSThreads 在后台运行操作,而不是使用在主 UI 之外运行的 NSTimers。我的大多数 NSTimers 都有“重复:”到 YES,因此我需要知道 NSThreads 是否可以循环。

谢谢凯文

4

1 回答 1

1
- (void) loop {
    while (!finished) { … };
}

- (void) startThreadedLoop {
    finished = NO;
    [self performSelectorInBackground:@selector(loop)];
}
于 2010-06-16T11:54:22.187 回答