Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个空闲时间和答案的人的问题...
我需要更改一个 NSString 值以输入到 AVAudioPlayer 开始偏移量
例如。player.currentTime = 0; 我想将“0”更改为可读值或将 NSString 更改为数值.....
NSString 有一个integerValue功能。您还可以使用它的format类函数创建一个 NSString 并将其传递给这样的格式字符串:"%d"然后您的player.currentTime.
integerValue
format
"%d"
player.currentTime
int timeInput = [[textField text] integerValue]; label.text = [NSString stringWithFormat:@"%d", timeInput];