I would like to stop function like this:
- (void)update:(NSTimeInterval)currentTime
{
if (self.lastUpdateTimeInterval)
{
_dt1 = currentTime - _lastUpdateTimeInterval;
}
else
{
_dt1 = 0;
}
CFTimeInterval timeSinceLast = currentTime - self.lastUpdateTimeInterval;
self.lastUpdateTimeInterval = currentTime;
[self moveObject];
}
I now timers stop like: [timer1 invalidate], but how to stop function that is running on timer interval?