I've been coding an app so that at the title screen music plays and when you tap to start the background music stops. How do I do that? I've tried lots of forums and none work. Here's my code to get the background music to start.
I'd like very detailed information for the solution.
Thanks!
Code:
- (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@"hrintro" ofType:@"wav"];
AVAudioPlayer* theAudio= [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
theAudio.numberOfLoops = 0;
[super viewDidLoad];
}
I'd like very detailed information for the solution.
Thanks!