Re: NSTimer is firing twice...
Re: NSTimer is firing twice...
- Subject: Re: NSTimer is firing twice...
- From: Jonathan del Strother <email@hidden>
- Date: Thu, 1 Jan 2004 16:22:09 +0000
Uhhh....nevermind.
I'd somehow managed to get 2 instances of my NSView class, hence 2
timers. That explains a whole lot of weirdness :)
On 1 Jan 2004, at 16:12, Jonathan del Strother wrote:
I have an NSTimer, set to fire once a second:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self
selector:@selector(updateFpsCounter) userInfo:nil repeats:true];
The function that it calls updates a counter in my interface:
- (void)updateFpsCounter
{
NSLog(@"Updating FPS");
[fps setStringValue:[NSString stringWithFormat:@"%i fps \n %i tps",
frameCount, tickCount]];
frameCount = 0;
tickCount = 0;
}
However, the timer is firing twice in quick succession. Here's my
output log :
2004-01-01 16:05:16.549 Emergence[2844] Updating FPS
2004-01-01 16:05:16.561 Emergence[2844] Updating FPS
2004-01-01 16:05:17.549 Emergence[2844] Updating FPS
2004-01-01 16:05:17.561 Emergence[2844] Updating FPS
2004-01-01 16:05:18.570 Emergence[2844] Updating FPS
2004-01-01 16:05:18.581 Emergence[2844] Updating FPS
- it seems to be calling the function twice, a few milliseconds
apart.
Any ideas what might cause this?
Thanks,
Jon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.