Search code examples
core-dataios5iphone-4persistent-storagempmediaitem

iPhone4 iOS5 how to save MPMediaItem with Core Data?


I'm trying to save a list of music files that the user has selected from the iPod music library. To do so, I get a list of persistentIDs which I will use to query the library later. I do this as follows:

NSNumber* persistentID = [mediaItem valueForProperty:[MPMediaItem persistentIDPropertyForGroupingType: MPMediaGroupingTitle]];

This method returns an id, which I assign to NSNumber. The numbers that I get are of this form: 4158583232547482294 . Which number format should I select to store such numbers in core data. Is this a Integer64?

Thank you!


Solution

  • After checking the Wikipedia, I can confirm that the 19 digit unsigned integer is indeed integer64. Here are other integer sizes: http://en.wikipedia.org/wiki/Integer_(computer_science)#Common_integral_data_types