I'm still new to Objective C syntax, so I might be overcomplicating this, but I can't seem to figure out how to pass an NSTimeInterval to a thread.
I want to initiate a thread that sleeps for x seconds parameter sent from main thread as follows:
[NSThread detachNewThreadSelector:@selector(StartServerSynchThread) toTarget:self withObject:5];
- (void) StartServerSynchThread:(NSTimeInterval *)sleepSecondsInterval {
[NSThread sleepForTimeInterval:sleepSecondsInterval];
}
But the compiler keeps giving me a syntax error. I'm not sure exactly how it should be done. Any help would be appreciated. Thanks!