0

This is where my build fails in JSQSystemSoundPlayer. I cannot get around this.

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

}
else {
    [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF];
}
Skper11
  • 61
  • 10
  • Have you included the appropriate header file? – michaelrccurtis Sep 09 '15 at 10:31
  • Yes, The library was as it is downloaded and added to project(not via pod though). in bridging header, I did import JSQSystemSoundPlayer #import "JSQSystemSoundPlayer.h" – Skper11 Sep 09 '15 at 10:33
  • Do you need a completion handler? I can't see the same method defined here: https://github.com/jessesquires/JSQSystemSoundPlayer/blob/develop/JSQSystemSoundPlayer/JSQSystemSoundPlayer/JSQSystemSoundPlayer.h – michaelrccurtis Sep 09 '15 at 10:34
  • In fact, looking at the history, the methods without completion blocks have now been removed. – michaelrccurtis Sep 09 '15 at 10:35
  • so you mean, I should re-download and add the JSQSoundPlayer or complete JSQMessagesVC to the latest ? – Skper11 Sep 09 '15 at 10:36

1 Answers1

2

According to the header file, I think you need to include a completion block (which you can set to nil if you don't want anything doing).

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

} else {
    [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF completion:nil];
}
michaelrccurtis
  • 1,172
  • 3
  • 14
  • 16
  • Awesome, worked perfectly. I got your point from your 2nd comment to add completion block, but was wondering what to add in the block. I'm such a amateur... Experience wins. – Skper11 Sep 09 '15 at 10:40