获取当前歌曲的图片时出错 [英] Error getting artwork for current song

查看:105
本文介绍了获取当前歌曲的图片时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抓住当前歌曲的专辑封面,并使用它来更改某些imageView.image会产生错误,但不再崩溃. (以前这样做是因为我省略了if (!artwork)错误处理.是吧.)

Grabbing album art for current song and using it to change a certain imageView.image generates an error, but no longer crashes. (It did before because I left out the if (!artwork) error handling. Eheh.)

此方法:

- (void)handleNowPlayingItemChanged:(id)notification {
    MPMediaItem *item = self.musicPlayer.nowPlayingItem;
    CGSize albumCoverSize = self.albumCover.bounds.size;
    MPMediaItemArtwork *artwork =
                            [item valueForProperty:MPMediaItemPropertyArtwork];
    if (artwork) {
        self.albumCover.image = [artwork imageWithSize:albumCoverSize];
    } else {
        self.albumCover.image = nil;
    }
}

像这样爆炸:

CPSqliteStatementPerform: attempt to write a readonly database for
    UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified
    FROM container WHERE pid=container_pid) WHERE orig_date_modified=0
CPSqliteStatementReset: attempt to write a readonly database for
    UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified
    FROM container WHERE pid=container_pid) WHERE orig_date_modified=0

但仅在启动时可用.并且它仍然显示图像(或缺少图像).奇怪的.

But only on launch. And it still shows the image (or lack thereof). Weird.

iPod库是只读的(应用程序不能更改任何东西,只能更改iTunes),所以也许它大吼大叫
我写了一个只读的东西,但由于没有修改任何只读而仍然允许它吗?

The iPod Library is readonly (apps can't change anything, only iTunes), so maybe it's yelling at
me for writing a readonly something, but still allowing it because nothing readonly is being modified?

在解决此问题之后,我需要重新调整大小(用于横向支持),而不是IB的拉伸.
不是很重要,但仍然是一件好事.

And after that's fixed, I need to get resizing working (for Landscape support) instead of IB's stretching.
Not vital, but still a nice thing to have.

推荐答案

此处链接-将其放在此处,以便将问题标记为已回答".

Putting this here so the question can be marked as Answered.

这篇关于获取当前歌曲的图片时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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