Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
530 views
in Technique[技术] by (71.8m points)

ios - How Do You Obtain the "Purchase Date" or "Date Added" from MPMediaItems in iPod Library

As users download new songs into their iPod Music library from the iTunes Store, I would like to programmatically list those songs in a table view. Is it possible to obtain the "Date Added" or "Purchase Date" from the MPMediaItemCollection? I see there are property keys such as play count and last played date. I know the data exists because it can be viewed in iTunes, but I am not finding it. Any suggestions on where to find this or how to derive it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As you can see in Apple Documentation for MPMediaItem http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMediaItem_ClassReference/Reference/Reference.html#//apple_ref/occ/cl/MPMediaItem, you access all the properties through enumerateValuesForProperties:usingBlock: or valueForProperty:, but there isn't a property for Date Added or Purchased Date informations.

This doesn't mean that the data isn't stored somewhere (surely it is): this just means that you cannot access that information through public APIs, maybe for privacy issues.

I don't know anyway if there is a way to obtain this information through some private API calls, but if it exists you can't use it for AppStore apps because it will cause you a rejection during review process.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...