I present the user with a table view of all the audio files listed in their documents directory of the app, alphabetically. I would like to allow advancing to the next track using headphones or the iPod audio controls built into iOS, but am not sure how to advance to whatever the next track is in the documents. My code to play it is to simply get the path to documents, and append it with the name of the row they click on in the table view. Is there a simple way to get the next file name from the path?
Share
You should probably get the contents of the folder in an array and then display it in a table after sorting. By this, every row points to a file in the array, which can be retrieved and played. To get the contents of a folder use the following line: