I am trying to save the MPMediaItem in nsmutableDictionary..
Actually my purpose is to let the user select his songs and then have it saved in the app and then whenever he wants he can play.
i have added this code for saving the MPMediaItem to Dictionary
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:mediaItemCollection.representativeItem forKey:@"name"];
and added it in a NSMutableArray and then that array into NSUserDefaults.
but when i try to do this i get this error:
[NSUserDefaults setObject:forKey:]:
Attempt to insert non-property value '(
{
desc = Test;
group = Main;
msg = Test;
name = test;
rec = (
{
name = "<MPConcreteMediaItem: 0x12b040> 8240103918041924793";
number = test;
}
);
type = "Play File";
}
)' of class '__NSArrayM'. Note that dictionaries and arrays in property lists must also contain only property values.