I want to create a background thread on the iPhone that executes some code every 10msec. But before I get lost in the concurrency programming guide and the threading program
You could easily use GCD (grand central dispatch) for that. First create a selector that will be called in the background. From here call whatever method you want.
- (void)backgroundSelector
{
// do whatever you want to do
[self performSelector:@selector(backgroundSelector) withObject:nil afterDelay:0.01];
}
After that just fire this method for the first time like this
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
[self backgroundSelector];
});
Let me know if that works for you.