IOS can I use AVAudioPlayer on the appDelegate?
I have a TabBarController with two tabs and I want to play music on both tabs. Right now I have my code on the main appDelegate NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"My Song" ofType:@"m4a"]]; // My Song.m4a NSError *error; self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; if (error) { NSLog(@"Error in audioPlayer: %@", [error localizedDescription]); } else { //audioPlayer.delegate = self; [audioPlayer prepareToPlay]; } but I'm getting the error Program received signal: "SIGABRT" on UIApplicationMain Is there a better way