English 中文(简体)
AVAudioPlayer forudioPlayerEnd Interruption means
原标题:Delegate AVAudioPlayer for audioPlayerEndInterruption method

页: 1 姓名为Mainview Controller,其中一米从事AVAudioer的所有行动。

档案中

@class MainViewController;

@protocol MainViewControllerDelegate 

-(void)audioPlayerBeginInterruption:(AVAudioPlayer *)audioPlayer;

-(void)audioPlayerEndInterruption:(AVAudioPlayer *)audioPlayer;

@end

@interface MainViewController : UIViewController <UIActionSheetDelegate, InfoDelegate, AVAudioPlayerDelegate> 

在上述发言中,我被混为一谈,一米应做AVAudioPlayerDelegate

如果是的话,@protocolAVAudioPlayerDelegate 然后是 黄色植被警报,称AVAudioPlayer的重复议定书定义被忽视

如果没有界定@protocolAVAudioPlayer,则在其他任何地方。

另一混淆 i 本应在案卷中宣布这些方法,但先在案卷中执行。

-(void)audioPlayerBeginInterruption:(AVAudioPlayer *)audioPlayer;

-(void)audioPlayerEndInterruption:(AVAudioPlayer *)audioPlayer;

请提供帮助。

最佳回答

我认为,你正在这里错误地使用@protocol建筑。 你们可以走下去,放弃整个@protocol块,并公正执行你们的班子。 仅需要打上你的班子,就象AVAudioPlayer这样的一个例子:

@interface MainViewController : UIViewController <UIActionSheetDelegate, InfoDelegate, AVAudioPlayerDelegate> 

接着,当你看一看你的AVAudio The PLayer Object, to ensure the MainViewController as the delegation:

audioPlayInstance.delegate = self;

Lastly, implement the two methods you want to be called on your AVAudioPlayer instance (I called it audioPlayInstance above). You only need to put these in your .m file, NOT you header. The header declaration for these methods is handled by the AVAudioPlayer.h class file.

Good Luck!

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。