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.
请帮助解决这个问题。检查我下面的代码。我正在尝试录制音频。在 ios 5.0 上一切正常,但在 ios5 上因以下代码行而崩溃。
[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&err];
此方法适用于 iOS 6。
查看文档
“适用于 iOS 6.0 及更高版本。”
您可以使用 respondsToselector: 检查防止崩溃。