WatchKit 项目无法识别 presentAudioRecordingControllerWithOutputURL

presentAudioRecordingControllerWithOutputURL not recognized in WatchKit project

我有一个 WatchKit 的现有项目,随着新版 WatchOS 的发布,Apple 已经实施了一种名为 presentAudioRecordingControllerWithOutputURL 的方法来从 AppleWatch 录制音频。

当我调用这个方法时有两个编译错误。我想我必须添加或包含更多内容,但我不知道我必须在我的项目中更改什么。

错误:

/path/myProject WatchKit Extension/AWMessagesController.m:278:56: 'WKAudioRecordingPresetWideBandSpeech' is unavailable: not available on iOS

/path/myProject WatchKit Extension/AWMessagesController.m:277:11: 'presentAudioRecordingControllerWithOutputURL:preset:maximumDuration:actionTitle:completion:' is unavailable: not available on iOS

presentAudioRecordingControllerWithOutputURL 不能在 iOS 扩展中使用。您必须适当地迁移您的代码(例如,将文件复制到监视目标)。参考Apple's documentation.