I have the following code in myScene.h:
#import <AVFoundation/AVFoundation.h>
And this code in the touchBegin method:
[self runAction:[SKAction playSoundFileNamed:@"fire.m4a" waitForCompletion:NO]];
The audio file is in the main folder. When I launch the application and touch the application, it shuts off and I get the following error:
Terminating app due to uncaught exception 'Missing Resource', reason: 'Resource fire.m4a cannont be found in the main bundle'
I thought this was a way to play audio in the Sprite Kit, but I have to do something wrong.
source share