Also, I was trying to figure out how to play music in games. Before, I just added the AVFoundation.framework file, #imported the header into the project, and then used this bit of code in awakeFromNib to load, play, and keep looping the music:
NSString* pathToMusicFile = [[NSBundle mainBundle] pathForResource:@"MusicFile" ofType:@"mp3"];
AVAudioPlayer* music = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:pathToMusicFile] error:NULL];
music.numberOfLoops = -1;
music.volume = 1;
[music play];
But every time I try this in the Ultimate iPhone Template, I get an error whether I compile for the simulator or for a device. Any help is much appreciated! Thanks.