The %02u
you're using in the stringWithFormat:
parses the value as an unsigned int.
Also, and I think this is your problem, you're checking testTask.timeInterval in your if
statement, but getting the number of seconds from the interval
variable you get at the start of the method.
So you're always checking the previous value, meaning you're always one second behind.
Edit: You could do somehting like this:
NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:date];
if (anotherTimeInterval-interval > 0){
...
}
That way, you check the new value instead of the old one.
Hope this helps