1

I am curious to know if you can loop an NSThread for the iphone sdk. I have learned that instead of using NSTimers which do run off of the main UI, I can use NSThreads to run actions in the background. Most of my NSTimers have the "repeats:" to YES, thus I need to know if NSThreads can be looped.

Thanks Kevin

lab12
  • 6,400
  • 21
  • 68
  • 106

1 Answers1

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

- (void) startThreadedLoop {
    finished = NO;
    [self performSelectorInBackground:@selector(loop)];
}
zoul
  • 102,279
  • 44
  • 260
  • 354