我目前正在研究聊天应用程序。我已经做了一个chatCellView和一个控制器。我已经通过编码包含播放按钮的音频进行了查看。现在我的问题是我无法识别正在播放哪个音频文件。需要一些有关如何实现这一目标的指导。
谢谢。
在CellforRowAtIndexPath中
AudioRecieveCell * cellRecieve =复用标识符= @“ AudioRecieveCell”; cellRecieve = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
cellRecieve.btnPlayResOutlet.tag=indexPath.row;
[cellRecieve.btnPlayResOutlet addTarget:self action:@selector(playResAudioPressed:) forControlEvents:UIControlEventTouchUpInside];
return cellRecieve;
现在将选择器设为-(void)playResAudioPressed:(id)sender {
UIButton btnSender =(UIButton)sender; 在这里写下你的逻辑
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句