MPMediaPickerController.showsCloudItems似乎什么都不做 [英] MPMediaPickerController.showsCloudItems seems to do nothing

查看:228
本文介绍了MPMediaPickerController.showsCloudItems似乎什么都不做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apple上发布此消息没有运气,但现在iOS 6 NDA已经启动,希望更多人会在这里看到它。

Posted this on Apple with no luck, but now that the iOS 6 NDA is up, hoping more eyes will see it here.

我正在尝试修改应用,只允许用户选择已在本地下载的音乐。我在iOS 6 GM下面有以下代码:

I am attempting to modify an app to only allow a user to select music that has been downloaded locally. I have the following code under iOS 6 GM:

 MPMediaPickerController* mpc = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio];

mpc.allowsPickingMultipleItems = YES;
mpc.modalPresentationStyle = UIModalPresentationCurrentContext;
mpc.showsCloudItems = NO;

[self presentViewController:mpc animated:YES completion:nil];

来自文档:


媒体项目选择器的默认行为是YES,这意味着选择器显示可用的iCloud项目的
。媒体项目被视为
iCloud项目,如果它可通过iTunes Match获得,并且尚未存储在设备上的

The default behavior for a media item picker is YES, which means the the picker shows available iCloud items. A media item is considered an iCloud item if it is available via iTunes Match and is not already stored on the device.

我认为这意味着如果启用了iTunes Match,则只有已下载到设备的项目才会显示在选择器中,但我总是会看到整个iTunes Match库。我为此提出了一个雷达,因为它似乎是一个严重的错误。如果有人能告诉我,我很想知道我在这里缺少什么。

I take this to mean that if iTunes Match is enabled, only items that have been downloaded to the device will show in the picker, however I always see the entire iTunes Match library. I filed a radar for this, because it seems like a serious bug. If anyone can tell me otherwise, I'd love to know what I'm missing here.

推荐答案

这似乎是一个操作系统问题。

This seems to be an OS problem.

使用 picker.showsCloudItems = NO; 正确显示更少的歌曲,而不是整个列表...那里列出的歌曲是在音乐应用程序中手动下载的歌曲或流式播放并因此缓存的歌曲。

Using picker.showsCloudItems = NO; correctly shows fewer songs, instead of the whole list... The songs listed there are songs that either were manually downloaded in the Music app or songs that were streamed and therefore cached.

问题,至少在我的情况下,是处理缓存的。

The problem, at least in my case, is dealing with the cached ones.

如果我选择手动下载的歌曲 MPMediaItemPropertyIsCloudItem ,这是正确的。我还可以通过 MPMediaItemPropertyAssetURL 属性访问资产的URL。

If I select a song that was manually downloaded the value of MPMediaItemPropertyIsCloudItem is NO, which is correct. I can also access the asset's URL through the MPMediaItemPropertyAssetURL property.

另一方面,选择一首歌曲缓存在上的 YES 返回& nil MPMediaItemPropertyAssetURL ,让这首歌对我来说几乎没用。

On the other hand, selecting a song that was cached returns YES on MPMediaItemPropertyIsCloudItem and nil on MPMediaItemPropertyAssetURL, making the song virtually useless to me.

抱歉,我没有实际答案,但我没有只需评论即可获得足够的声誉。

Sorry I don't have an actual answer but I don't have enough reputation to simply comment.

希望我的2美分在某种程度上有所帮助,但在我看来,这个问题只能由Apple在未来的更新中解决。

Hope my 2 cents help somehow, but it truly seems to me that this issue can only be resolved by Apple in a future update.

这篇关于MPMediaPickerController.showsCloudItems似乎什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆