Re: NSTimer or double to int cast (Bug?)
Re: NSTimer or double to int cast (Bug?)
- Subject: Re: NSTimer or double to int cast (Bug?)
- From: Cameron Hayne <email@hidden>
- Date: Fri, 10 Jan 2003 10:07:42 -0500
On 10/1/03 8:05 am, "Marco Binder" <email@hidden> wrote:
>
@implementation Controller
>
- (id) init {
>
if (self = [super init]) {
>
double interval = 1.0;
>
timer = [[NSTimer scheduledTimerWithTimeInterval:interval
>
target:self selector:@selector(timerAction:) userInfo:nil repeats:YES]
>
retain];
>
}
>
return self;
>
}
>
>
- (void) timerAction: (id) sender {
>
NSLog(@"- interval as returned: %f, interval as int: %d",[timer
>
timeInterval], (int)[timer timeInterval]);
>
}
>
@end
>
>
[...]
>
On the other hand on the G3 iBook:
>
2003-01-10 14:00:37.286 TimerTest[413] - interval as returned:
>
1.000000, interval as int: 0
>
[...]
>
I am not making this up, and you are more than welcome to downlad the
>
project at: http://www.sb-software.de/TimerTest.tgz
You forgot to put the .pbproj and main.m files in the above tarball.
But when I put your Controller files into a new Foundation project and add
the following lines into main.m:
[[Controller alloc]init];
[[NSRunLoop currentRunLoop] run];
I get "interval as int: 1" on my iBook.
Maybe you should give us a full project to try out so we can do exactly what
you are doing?
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.