ios - 'JSQSystemSoundPlayer' 没有可见的@interface 声明选择器 'playSoundWithFilename:fileExtension:'

标签 ios swift jsqmessagesviewcontroller

这是我在 JSQSystemSoundPlayer 中构建失败的地方。我无法解决这个问题。

if (asAlert) {
    [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF];

}
else {
    [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF];
}

最佳答案

根据头文件,我认为您需要包含一个完成 block (如果您不想做任何事情,可以将其设置为 nil)。

if (asAlert) {
    [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF completion:nil];

} else {
    [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF completion:nil];
}

关于ios - 'JSQSystemSoundPlayer' 没有可见的@interface 声明选择器 'playSoundWithFilename:fileExtension:',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32477117/

相关文章:

ios - SQL 错误 : Not an Error

iphone - iCloud:KeyValue 存储还是文档存储?

JSQMessagesViewController 动画输入指示器

Swift - 适用于 ios 7 的 JSQMessagesViewController?

ios - 我可以在 JSQMessagesViewController 单元格中为 textView.text 使用 NSAttributedString 吗?

ios - Iphone 监听一个 tcp 端口

objective-c - 循环缓冲录音iOS : Possible?

swift - 在 NSMutableURLRequest 中设置主体不起作用

Swift 3 如何在自定义类上声明赋值运算符

ios - AutoLayout - 无法同时满足 swift5 中的约束条件