double duration = 20; // duration is in seconds
NSDate* durationDate = [[NSDate alloc]initWithTimeIntervalSinceReferenceDate:duration];
NSDateFormatter *formatter = nil;
formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"mm:ss"];
NSString *durationString=[formatter stringFromDate:durationDate];//here durationString should have 20
但我得到了 30:20?从哪里添加这 30 分钟。我试过给更大的数字然后也是同样的结果
请让我知道对此的想法以及如何解决这个问题