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