Tag: json c

iOS格式的string分为几秒钟

我收到来自YouTube JSONC API的string,但是持续时间将以2321而不是23:21或2而不是0:02来表示。 我怎么去解决这个问题? JSON C. 编辑: int duration = [videos valueForKey:@"duration"]; int minutes = duration / 60; int seconds = duration % 60; NSString *time = [NSString stringWithFormat:@"%d:%02d", minutes, seconds];