Tobe wrote:
I already have the time interval as NSTimeInternal. The real problem is how format the time interval like a date into a string.
You can't. A timer interval is just a double. If you want to represent it as a formatted time string, you'll have to do it yourself. The following is standard procedure:
- (NSString *) formatInterval: (NSTimeInterval) interval
{
unsigned long seconds = interval;
unsigned long minutes = seconds / 60;
seconds %= 60;
unsigned long hours = minutes / 60;
minutes %= 60;
NSMutableString * result = [[NSMutableString new] autorelease];
if(hours)
[result appendFormat: @"%d:", hours];
[result appendFormat: @"%02:", minutes];
[result appendFormat: @"%02", seconds];
return result;
}
Enhance and/or fix bugs as needed.