我有一个 iOS 应用程序,它使用了许多不同的音频文件,记录在应用程序中并保存。我已经导入了 AVFoundation 框架,但是我仍然得到错误:
选择器“URLAssetWithURL”没有已知的类方法
这是我的代码:
AVAsset *asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:audioFiles[indexPath.row]]];
waveformView.asset = asset;
audioFiles 数组内部是一个本地 URL,如下所示:
file:///var/mobile/Containers/Data/Application/6B35F9EA-1896-4989-91AF-06850B74B2E9/Documents/record_sound_1.aif
我究竟做错了什么?