iOS 9.2, Xcode 7.2, ARC enabled
I recently ran into this problem. Definitely do what the original authors suggest. For me it was the actual file name, which was the problem, see below ...
NSString *pathForPuzzlePieceHitSound = [[NSBundle mainBundle] pathForResource:@"puzzle_piece_hit" ofType:@"m4a"]; NSURL *urlForPuzzlePieceHitSound = [NSURL fileURLWithPath:pathForPuzzlePieceHitSound]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)urlForPuzzlePieceHitSound, &idForPuzzlePieceHitSound);
File name:
@"puzzle_piece_hit"
Does it contain characters that are illegal for naming files using this particular method. I think you can treat it and work around the problem, but it's easier to just rename the file.
After I renamed to:
@"puzzlePieceHit"
Everything worked fine.
Hope this helped someone! Greetings.
serge-k
source share