1

有人知道怎么做吗?标准方法不起作用。我希望用户选择一首歌曲,然后将其保存以供下次加载应用程序时使用,但我似乎无法将其放入 NSUserDefaults。

4

1 回答 1

1

You need to iterate the collection to get the MPMediaItems. MPMediaItem inherits from MPMediaEntity, which has a -valueForProperty: method. If you pass that method the MPMediaItemPropertyPersistentID constant, you'll get back an NSNumber that uniquely identifies the item. This is a value that's persistable across launches.

于 2011-02-07T03:41:35.347 回答