I want to play a system sound on my iphone, the sound plays very well in the simulator but on the device doesn't work.
- (IBAction)SystemSound:(id)sender {
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"waterfall" ofType:@"caf"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundFileURL, &systemSound);
AudioServicesPlaySystemSound(systemSound);
}