Die UIImage
"Bild" ist immer leer ("null"), obwohl die Abdeckung in der Musik-App von Apple angezeigt wird. in iOS 7 funktioniert es gut, aber mit iOS 8 bekomme ich keine Deckung.MPMediaItemArtwork ist null, während Abdeckung in iTunes verfügbar ist
Was ist falsch an meinem Code oder was hat sich in iOS 8 geändert?
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
AlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell"];
MPMediaItemCollection *song = self.songsList[indexPath.row];
cell.albumName.text = [[song representativeItem] valueForProperty: MPMediaItemPropertyAlbumTitle];
cell.albumArtist.text = [[song representativeItem] valueForProperty:MPMediaItemPropertyAlbumArtist];
CGSize artworkImageViewSize = CGSizeMake(100, 100);
MPMediaItemArtwork *artwork = [song valueForProperty:MPMediaItemPropertyArtwork];
UIImage *image = [artwork imageWithSize:artworkImageViewSize];
NSLog(@"-------------------");
NSLog(@"%@",[[song representativeItem] valueForProperty: MPMediaItemPropertyAlbumTitle]);
NSLog(@"%@",image);
if (artwork) {
cell.cover.image = image;
}
else
{
cell.cover.image = [UIImage imageNamed:@"nocover.png"];
}
return cell;
}
ja, wenn ich das gleiche Lied oder ein Album in der Musik-App spiele, gibt die Grafik. – Meins
Artwork! = Nil ABER image == nil gibt es ein Problem mit imageWithSize:? – Meins
Ich habe es in einem neuen Projekt versucht, es funktioniert nicht, hier das Projekt http://www.file-upload.net/download-9572664/TestCover.zip.html – Meins