I have this code, I save total second counting and load it in result view controller. and in my result view controller, I put this code,
- (void) counting
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *loadSecond = [defaults objectForKey:@"saveSecond"];
NSLog(@"last save is %@", loadSecond); // in here, log is displaying 30 seconds
scratch = fmod(secondCount,3600);
hour = secondCount / 3600;
minute = scratch / 60;
second = fmod(scratch,60);
labelRecord.text = [NSString stringWithFormat:@"%d:%d:%d", hour , minute, second];
}
From above, NSLog is displaying my last save counting for 30 seconds, and it is right but how do i change that 30 seconds to secondCount? because i want use it in my labelRecord.
Change this line
to
This assumes that the object for the key saveSecond is a
NSNumber.