Without a lot of code, it's hard to say what you are doing, but here are some things to try to apologize if this is obvious.
Do you keep a link to a timer?
This can be useful for debugging. If you have a property called makeTargetTimer , you can do this:
NSTimer * makeTargetTimer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(createTargets) userInfo:nil repeats:YES]; self.makeTargetTimer = makeTargetTimer
The only way to stop the re-timer is to invalidate it. Therefore, you can check to see if it was invalid.
BOOL isInvalidated = [self.makeTargetTimer isValid];
You can also do this in your dealloc method:
- (void) dealloc { [_makeTargetTimer invalidate];
Do you scroll when you need to take an even number?
If you want the timer to NSRunLoopCommonModes while scrolling, you need to use NSRunLoopCommonModes . There is a great atonement in this matter .
[[NSRunLoop currentRunLoop] addTimer:makeTargetTimer forMode:NSRunLoopCommonModes];
What is your implementation of createTargets like?
- You put
NSLog expressions in the body of this method. Are you sure it is not called?
source share