Posts

Post not yet marked as solved
0 Replies
509 Views
Hi all, Hope you're doing well today. I'm working with the MPMediaItemPropertyLyrics variable provided by the MediaPlayer framework. I'm accessing the user's Apple Music library. The content that I'm playing within my application are all downloaded and stored locally. I'm utilizing the MPMediaItemPropertyLyrics variable which is type NSString, however no text is returned. I can validate that there are lyrics by comparing the same MediaItem object within Apple's Music application. I have an If else statement where if there are no lyrics available, I return a "Lyrics Not Available" text to the UITextView. However while stepping through the runtime debugger I can see that the function is returning that there are lyrics. Here's my code within the implementation file. (Yes objective-c, though I'm open to Swift resolutions as well).        MPMediaItem *currentItem = [self.musicPlayer nowPlayingItem]; NSString *MPlyrics = [currentItem valueForProperty:MPMediaItemPropertyLyrics]; if (MPlyrics) {                 NSLog(@"Here are the Lyrics: %@",MPlyrics);                 self.lyrics.text = MPlyrics;             } else {                 NSLog(@"No Lyrics");                 self.lyrics.text = @"Lyrics Not Available";             } Here's the property that I have in the header file @property (nonatomic, readonly) NSString *lyricsString; I've tried setting the property to (nonatomic, readonly, copy). Am I doing wrong here? Am I missing something? Would love your thoughts everyone! Let me know if you have any questions.
Posted Last updated
.