nowPlayingInfo
new ofを設定すると、 new perform ごとに値が[MPNowPlayingInfoCenter defaultCenter]
置き換えられることに気付きました。しかし、標準の iphone music.app では、それは起こりません! では、古いアートワークを保持するように設定するにはどうすればよいでしょうか。MPMediaItemPropertyArtwork
setNowPlayingInfo:
nowPlayingInfo
NSMutableDictionary *mediaInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:recording.releaseGroup.title, MPMediaItemPropertyAlbumTitle, recording.releaseGroup.artist.title, MPMediaItemPropertyArtist, recording.title, MPMediaItemPropertyTitle, recording.lyrics, MPMediaItemPropertyLyrics, itemsCount, MPMediaItemPropertyAlbumTrackCount, itemNumber, MPMediaItemPropertyAlbumTrackNumber, nil];
self.artwork = [[[MPMediaItemArtwork alloc] initWithImage:_coverView.image] autorelease];
[mediaInfo setValue:_artwork forKey:MPMediaItemPropertyArtwork];
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:mediaInfo];
このブロックは、トラックの変更が再生されるたびに実行されます