1
-(IBAction)musiconButtonClicked:(id)sender{
NSString *path = [[NSBundle mainBundle] pathForResource:@"NextRevIt" ofType:@"mp3"];
AVAudioPlayer* audioPlayer = [[AVAudioPlayer alloc ] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[audioPlayer play];
}
-(IBAction)musicoffButtonClicked:(id)sender{
[audioPlayer stop]; <----says this is undeclared?
}
我能得到的音頻播放罰款,但如何使一個按鈕,停止音頻?在iphone上播放mp3 sdk?
不要忘記@syntheize它在.M和dealloc的它如上所述。 – CW0007007 2011-12-13 14:21:22