Objective c 播放多个声音时出现目标C错误 我想用AVoooPoor和基金会播放很多声音。 代码是这样的 - (IBAction)pushButton19 { NSString *path = [[NSBundle mainBundle] pathForResource:@"The Terminator" ofType:@"mp3"]; AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; } - (IBAction)pushButton20 { NSString *path = [[NSBundle mainBundle] pathForResource:@"The Wizard of Oz" ofType:@"mp3"]; AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; }
在Objective c 播放多个声音时出现目标C错误 我想用AVoooPoor和基金会播放很多声音。 代码是这样的 - (IBAction)pushButton19 { NSString *path = [[NSBundle mainBundle] pathForResource:@"The Terminator" ofType:@"mp3"]; AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; } - (IBAction)pushButton20 { NSString *path = [[NSBundle mainBundle] pathForResource:@"The Wizard of Oz" ofType:@"mp3"]; AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; },objective-c,Objective C,在行中,audio.delegate=self 上面说 类*不实现 协议 以及 分配给ID的语义问题 从…起 不兼容类型MainView* 我需要做些什么来修复它?你能给我看一下正确的代码吗?因为我现在是一个noob?你的控制器必须符合协议并实施必要的方法 您的控制器必须符合协议并实施其必要的方法
行中,audio.delegate=self代码>
上面说
类*不实现
协议
以及
分配给ID的语义问题
从…起
不兼容类型MainView*
我需要做些什么来修复它?你能给我看一下正确的代码吗?因为我现在是一个noob?你的控制器必须符合协议并实施必要的方法 您的控制器必须符合协议并实施其必要的方法