1

I am getting this error:

/: No visible @interface for 'JSQSystemSoundPlayer' declares the selector 'playAlertSoundWithFilename:fileExtension:'

I am creating a chat app with JSQMessagesViewController. Here is the code:

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

The error is on both, the if and the else statements. How do I fix this?

Sushil Sharma
  • 2,321
  • 3
  • 29
  • 49
ojassethi
  • 379
  • 1
  • 5
  • 16

1 Answers1

1

Hey not sure if you got it working yet or not, but you simply have to add a completion handler like so:

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

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

I patched it on github if you don't feel like digging through the code:

https://github.com/FridayDevGroup/JSQMessagesViewController

Frogger
  • 86
  • 1
  • 8