I have the following line of code which is running on a timer:
NSLog( @" seconds: %i, elapsedhours %f", [self elapsedSeconds], [self elapsedSeconds] / 3600);
It prints out:
seconds: 0, elapsedhours 0.000000
seconds: 1, elapsedhours 0.000000
seconds: 2, elapsedhours 0.000000
seconds: 3, elapsedhours 0.000000
I'm wondering why elapsed hours doesn't update?
Method for elapsedSeconds:
- (NSUInteger)elapsedSeconds;
{
NSUInteger seconds = 0;
if( ![self endDate] ) {
seconds = [[NSDate date] timeIntervalSinceDate: [self startDate]];
NSLog( @" startdate = %@ no end date %i", startDate, seconds );
}
else {
seconds = [[self endDate] timeIntervalSinceDate: [self startDate]];
}
return seconds;
}
Anything else you guys/gals need to see?
TIA