cocoa|锁屏显示正在播放的音乐

Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter"); if (playingInfoCenter) {NSMutableDictionary *songInfo = [ [NSMutableDictionary alloc] init]; MPMediaItemArtwork *albumArt = [ [MPMediaItemArtwork alloc] initWithImage: [UIImage imagedNamed:@"AlbumArt"] ]; [ songInfo setObject: @"Audio Title" forKey:MPMediaItemPropertyTitle ]; [ songInfo setObject: @"Audio Author" forKey:MPMediaItemPropertyArtist ]; [ songInfo setObject: @"Audio Album" forKey:MPMediaItemPropertyAlbumTitle ]; [ songInfo setObject: albumArt forKey:MPMediaItemPropertyArtwork ]; [ [MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo ]; }

【cocoa|锁屏显示正在播放的音乐】





    推荐阅读