I'm seeing some small amounts of SpriteKit playSoundFileNamed crashes from my app's crash log. The crashes happen on iOS 8.3.
0 CoreFoundation __exceptionPreprocess
1 libobjc.A.dylib objc_exception_throw
2 CoreFoundation -[NSException initWithCoder:]
3 SpriteKit +[SKPlaySound playSoundFileNamed:atPosition:waitForCompletion:]
4 SpriteKit +[SKAction(SKActions) playSoundFileNamed:waitForCompletion:]
...
And a few related crashes:
0 CoreFoundation __exceptionPreprocess
1 libobjc.A.dylib objc_exception_throw
2 CoreFoundation -[NSException raise:format:]
3 SpriteKit +[SKPlaySound playSoundFileNamed:atPosition:waitForCompletion:]
4 SpriteKit +[SKAction(SKActions) playSoundFileNamed:waitForCompletion:]
...
Does anyone know what causes this crash and how to fix it? Should I wrap every calls to playSoundFileNamed: in a try-catch block?
Edited
More information:
I'm using Swift. Trying to play my own sounds and I'm seeing the crashes coming from different sounds. I'm also seeing a couple reports from iOS 8.2 so this crash might not be iOS 8.3 specific.
The lines that play the sound:
var sound = SKAction.playSoundFileNamed("Sound/ABC.mp3", waitForCompletion: false)
self.runAction(sound)