ios - How to save MPMediaItemCollection to database? -
i'm making application allows user make playlist , edit playlist , using mpmusicplayercontroller. able make playlist , retrieve can played. don't know how can store playlist(mpmediaitemcollection) core data or database, user have many playlist.
i've tried play ipod playlist retrieved saved persistentid list , realize it's can save 1 playlist. cmiiw
so how can save many playlist in core data or nsuserdefaults ?
create mutable array add playlist in array via addobject
nsuserdefaults.standarduserdefaults().setobject(playlistarray, forkey: "playlists") nsuserdefaults.standarduserdefaults().synchronize()
don't forget fetch data in array nsuserdefaults
before next playlist creation.
Comments
Post a Comment