Hey folks,
I need to run a timer independently of the main loop. So I've been reading up on NSOperation and NSOperationQueue. Most of the documentation is straightforward.
My only question is in regards to the communication between threads. I want to be able to output the timer to a label back on my view controller that is going to queue the NSOperation subclass. I've found "performSelectorOnMainThread:" method which should do what I need. However, I'm a little fuzzy on how I can reference the main thread in that function.
See question marks in code...
Also is this the only way to pass information back to the main thread?
I need to run a timer independently of the main loop. So I've been reading up on NSOperation and NSOperationQueue. Most of the documentation is straightforward.
My only question is in regards to the communication between threads. I want to be able to output the timer to a label back on my view controller that is going to queue the NSOperation subclass. I've found "performSelectorOnMainThread:" method which should do what I need. However, I'm a little fuzzy on how I can reference the main thread in that function.
See question marks in code...
Code:
[??? performSelectorOnMainThread:@selector(someMethodInViewController:) withObject:someObject waitUntilDone:NO];
Also is this the only way to pass information back to the main thread?