I am trying to play back 4 audio files at random when they are called. here is code
// randomize the playback on the setShot files
int randomNumber = arc4random() % 4 + 1;
NSString *tmpFileName = [[NSString alloc] initWithFormat:@"SetShot%d", randomNumber];
NSString *fileName = [[NSBundle mainBundle] pathForResource:tmpFileName ofType:@"aif"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:fileName], &soundID);
AudioServicesPlaySystemSound (soundID);
I am getting the above crash on my device not in the simulator. I am fairly new to coding. Thanks for all your help.
The sound files are SetShot01 thru to SetShot04
ARC-armv6,armv7 xcode 4.3.2 on device with 5.1.1