これを修正する方法を教えてください。彼らが演奏を終えたときに2つの異なったものをリリースしたいと思います。2つの「audioPlayerDidFinishPlaying」を使用できません
ここに私のコードです:
.hファイル
@interface ViewController : UIViewController <AVAudioPlayerDelegate>
{
NSString *path;
}
- (IBAction)Short:(id)sender;
- (IBAction)BeatLong:(id)sender;
.mファイル
AVAudioPlayer *media;
AVAudioPlayer *media2;
- (IBAction)Short:(id)sender
{
path = [[NSBundle mainBundle] pathForResource:@"Short" ofType:@"wav"];
media = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[media setDelegate:self];
[media play];
}
- (IBAction)Beat:(id)sender
{
path = [[NSBundle mainBundle] pathForResource:@"Beat" ofType:@"mp3"];
media2 = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[media2 setDelegate:self];
[media2 play];
}
(新しいトンで画像を開きます。 abをもっとよく見て^^、)
は、私はあなたの返事のため – Aluminum