im trying to play a sound when a button is pressed. when i run the app on my phone it runs fine but when i press the button it plays the sound then quits. however it works fine in the simulator.
i have tried AudioServicesPlaySystemSound and also AVMediaPlayer and they both crash...
any ideas??
heres the code from my IBAction of the button
Code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"noob launch" ofType:@"wav"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef) [NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound (soundID);