带有 AVPlayer 的选项卡栏从 tableview 获取信息?
我有一个播放音频的 AVPlayer。 我需要的是,有一个 TableView 或类似的东西,带有一些名称,例如:Tom Jones,如果在 tableview 中选择了该名称,它将向我的 AVPlayer 传递一个字符串,以便 AVPlayer 更改歌曲。
I have a AVPlayer that playes audio.
What i need is, to have a TableView or something like it, with some names like: Tom Jones, and if that one is selected in the tableview, it passes a string to my AVPlayer, so the AVPlayer changes song.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法可以给这只猫剥皮。
*语法未验证
当然,只有当您定义了“self.player”和“myArray”时,这才有效
self.player 是您的 AVPlayer,myArray 是一组字典,可能与您在 UITableView 数据源中使用的字典数组相同
many ways to skin this cat.
*syntax not verified
this will only work of course if you have defined 'self.player' and 'myArray'
self.player being your AVPlayer and myArray being an array of dictionaries, probably the same one that you would use in your UITableView DataSource