我想以某种方式缩短或占用更少的空间。
totalTime = [self timeFormatted:([currentFeed duration].intValue)-1];
NSString *word = @":00:";
if ([totalTime rangeOfString:word].location == NSNotFound) {
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"00:" withString:@""];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"01:" withString:@"1:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"02:" withString:@"2:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"03:" withString:@"3:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"04:" withString:@"4:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"05:" withString:@"5:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"06:" withString:@"6:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"07:" withString:@"7:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"08:" withString:@"8:"];
totalTime = [totalTime stringByReplacingOccurrencesOfString:@"09:" withString:@"9:"];
}
任何帮助是极大的赞赏。