I have a repeated timer with interval of 1/4 second. I am initializing it like this:
[NSTimer scheduledTimerWithTimeInterval:0.25
target:self
selector:@selector(toggleCams)
userInfo:nil
repeats:YES];
Does this happen synchronously? In other words, am I guaranteed that another method in the same class will not be called at the same time toggleCams is called?
The NSTimers actually just periodically fire events into the enclosing NSRunLoop, which each thread has (or should have). So, if you have a child (or background) process running in a different thread, the NSTimers will fire against that thread's NSRunLoop instead of the application's main NSRunLoop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With