0
在我的代码的时候:问题与播放声音的按钮被点击
#import "MyViewController.h"
#import "AVFoundation/AVAudioPlayer.h"
- (IBAction)playSound{
AVAudioPlayer *myExampleSound;
NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];
myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];
myExampleSound.delegate = self;
[myExampleSound play];
}
但它显示出类MyViewController没有实现AVAudioplayerDelegate警告。
请人帮忙。我已经包括AVFoundation.Framework。
它的工作!非常感谢你!! – isarathg 2010-03-31 04:06:50