I would like to create an audio player using UITableView. Every song needs to be a row in this table view controller and I expect every cell to have a play/stop button (only two states). I am managing all the audio meta-data using Core Data and actually storing t开发者_Go百科he song files inside the sandbox (this is a demo application). Which is the best way to go about it? How can I have dynamic content inside UITableViewCells?
Any help is highly appreciated!
Thanks Ravi
- Subclass UITableViewCell to create two buttons inside of your cells.
Assign them actions in the controller for the tableView, and check the indexPath (or a custom identifier assigned to the cell, but that wouldn't be very mvc aware...) of the cells that were toggled to know what sound to play.
- Be careful with how the cells are reused to know what state to display.
精彩评论