- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 iOS 应用程序,它使用应用程序中录制并保存的许多不同的音频文件。我已经导入了 AVFoundation 框架,但是我仍然收到错误:
No known class method for selector '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
我做错了什么?
最佳答案
类方法有两个参数,URL 和一些选项。更改为:
AVAsset *asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:audioFiles[indexPath.row]] options:nil];
waveformView.asset = asset;
我希望 XCode 的自动完成和突出显示能够明显表明您正在使用一种不存在的方法...
关于ios - 选择器 'URLAssetWithURL' 没有已知的类方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28639297/
我有一个 iOS 应用程序,它使用应用程序中录制并保存的许多不同的音频文件。我已经导入了 AVFoundation 框架,但是我仍然收到错误: No known class method for se
我没有找到关于这个的文档,但是根据我的实践经验 AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil]; (其中 url 是
我是一名优秀的程序员,十分优秀!