【发布时间】:2010-07-09 13:00:40
【问题描述】:
我喜欢用户从可用的音频列表中选择一个音频文件并将其复制到我自己的应用程序中。在 Apple 示例代码“AddMusic”中检索到的 userMediaItemCollection 项中有属性:MPMediaItemPropertyAssetURL。但我无法解决,因为我收到错误“MPMediaItemPropertyAssetURL undeclared” - 尽管我导入了MPMediaItem.h。
在苹果文档中它说:
MPMediaItemPropertyAssetURL
指向媒体项目的 URL,可以从中创建 AVAsset 对象(或其他基于 URL 的 AV Foundation 对象),并根据需要使用任何选项。值是一个 NSURL 对象。
该 URL 具有 ipod-library 的自定义方案。例如,一个 URL 可能如下所示: ipod-library://item/item.m4a?id=12345
Usage of the URL outside of the AV Foundation framework is not supported.
适用于 iPhone OS 4.0 及更高版本。
在 MPMediaItem.h 中声明
Does that mean, it is not possible to access the audio files for own use?
Is there a workaround?
非常感谢
【问题讨论】:
-
四处寻找之后,我什么也没找到。因此,在应用关闭后持久访问所选歌曲的唯一其他好方法就是使用 MPMediaItemPropertyPersistentID。
标签: iphone audio mpmediapickercontroller mpmediaitem