艺术家形象不显示,只是他们音乐的艺术品

时间:2014-06-02 01:13:28

标签: ios objective-c iphone ios7

我有tableView,显示用户iPod库中的艺术家列表。单元格的图像应显示艺术家的图像。

目前,我得到了这个(艺术家的一首歌的专辑封面):

enter image description here

当图像显示时(Music.app在同一台设备上显示):

enter image description here

这是我tableView的代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    MPMediaItemCollection *artistCollection = artists[indexPath.row];

    MPMediaItemArtwork *artwork = [[artistCollection representativeItem] valueForProperty:MPMediaItemPropertyArtwork];

    UIImage *artistImage = [artwork imageWithSize: CGSizeMake (44, 44)];

    cell.imageView.image = artistImage;

    return cell;

}

我已阅读课程参考资料,但找不到提供艺术家形象的任何内容。有人知道怎么做吗?谢谢!

0 个答案:

没有答案
相关问题