Created
April 22, 2013 13:32
-
-
Save tiagobbraga/5434895 to your computer and use it in GitHub Desktop.
iTunes Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iOS5 Only | |
- (void) setMediaInfo { | |
NSMutableDictionary * dict = [[NSMutableDictionary alloc] init]; | |
NSString * imName = @"imagetest.png"; // Artwork image | |
[dict setObject:NSLocalizedString(@"My Music", @"") forKey:MPMediaItemPropertyTitle]; | |
[dict setObject:NSLocalizedString(@"Myself Artist", @"") forKey:MPMediaItemPropertyArtist]; | |
MPMediaItemArtwork * mArt = [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:imName]]; | |
[dict setObject:mArt forKey:MPMediaItemPropertyArtwork]; | |
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = nil; | |
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:dict]; | |
[dict release]; // not use ARC | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment