I need help in this code,
I am trying to play sounds when a button is pressed on the iPhone app and I get this error. Here is the code
-(IBAction)playSound:(id)sender{
// NSLog(@"play Sound");
SystemSoundID soundID;
NSString *buttonName = [sender currentTitle];
NSString *soundFile = [[NSBundle mainBundle]
pathForResource:buttonName ofType:@"wav"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:soundFile], &soundID);
AudioServicesPlaySystemSound(soundID);
[soundFile release];
The error messages say
Release is unavialable: not available in automatic reference counting mode
ARC forbids explicit message 'release'
*Cast of Objective-C pointer type 'id' to C pointer type 'CFURLRef' (aka 'const struct __CFURL ') requires a bridged cast