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