我在NSArray
中播放了歌曲列表,並在我的UITableView
中顯示歌曲,如下圖所示。在iOS中使用MPMusicPlayerController從播放列表中播放和跳過下一首歌曲
對我來說,當我選擇從UITableView
一首歌曲,我想打這首歌與MPMusicPlayerController's
applicationMusicPlayer
。
我的意思是,當我從UITableView
選擇美國白癡,我想打美國白癡與MPMusicPlayerController's
當我點擊下面的跳過按鈕,它必須像郊區的耶穌播放下一首歌曲。
這裏是我的代碼,加載歌曲的UITableView
self.player = [MPMusicPlayerController applicationMusicPlayer];
MPMediaQuery *query = [MPMediaQuery playlistsQuery];
MPMediaPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:@"GreenDay" forProperty:MPMediaPlaylistPropertyName comparisonType:MPMediaPredicateComparisonContains];
[query addFilterPredicate:predicate];
self.arrayOfSongs = [query items];
我想你明白我的意思。 我想做所有的音樂按鈕工作,如iOS的音樂應用程序內建和播放歌曲,當我從UITableView
選擇歌曲。
我正在嘗試,但我沒有找到可以解決我的問題的解決方案。
請幫我這樣做。
謝謝你。 :)
我們可以從iPod音樂中選取播放列表嗎? – SRI