Hi I am new to programing, and I have been working on an app that plays a random sound when you press a button. No I'm not making another fart app.
The program does not show any errors, However when the app loads, on both the sim and device, when i press the button it just stays blue and freezes. Any help would be very appreciated. here is the code Im using:
- (IBAction)playSound

id)sender
{
int randomNumber = arc4random() % 25 + 1;
NSString *tmpFileName = [[NSString alloc] initWithFormat:@"sound%d", randomNumber];
NSString *fileName = [[NSBundle mainBundle] pathForResource:tmpFileName ofType:@"aif"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:fileName], &soundID);
AudioServicesPlaySystemSound (soundID);
[tmpFileName release];
[fileName release];
}
I know its probably something simple with my code but once again I am new to programing and am still coming to terms with this language.