0

我有一个应用程序,让用户选择歌曲,然后将这些歌曲存储到核心数据表中。我存储歌曲名称、艺术家、专辑和歌曲持续时间。我需要重播这个。我想我可以将歌曲名称加载到某种数组中并以这种方式播放。我是否应该同时存储 MPMediaItemPropertyPersistentID 以及我应该保存的任何其他属性?

另外,我该如何从所述阵列播放歌曲。有样品吗?教程?

提前致谢。

-保罗。

4

1 回答 1

0

use the MPMusicPlayerController class http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMusicPlayerController_ClassReference/Reference/Reference.html

and the AddMusic sample code from Apple http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008845

and yes, the MPMediaItemPropertyPersistentID is how you will reference the tracks - it remains consistent across syncs.

于 2012-03-17T10:00:26.470 回答