Persist a MPMediaItemCollection Object Using NSUserDefaults
问题 How do you persist a MPMediaItemCollection object using NSUserDefaults? The MPMediaItemCollection object is a single song selected from the iPod. I have been struggling with this for hours! Anyone have any ideas or alternatives to NSUserDefaults or a conversion from MPMediaItemCollection, or anything?! Thanks... 回答1: First convert/encode the MPMediaItemCollection to an NSData Object and store it using NSUserDefaults using: NSData *data = [NSKeyedArchiver archivedDataWithRootObject