0

このエラーが発生しています:

/: 「JSQSystemSoundPlayer」の目に見える @interface はセレクター「playAlertSoundWithFilename:fileExtension:」を宣言しません

でチャットアプリを作成していJSQMessagesViewControllerます。コードは次のとおりです。

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

エラーは、if ステートメントと else ステートメントの両方にあります。これを修正するにはどうすればよいですか?

4

1 に答える 1

1

まだ動作しているかどうかはわかりませんが、次のように完了ハンドラーを追加するだけです。

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

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

コードを掘り下げたくない場合は、github にパッチを適用しました。

https://github.com/FridayDevGroup/JSQMessagesViewController

于 2016-01-15T12:27:46.717 に答える