ios - How to save NSMutableArray to parse? -


i have nsmutablearray called theplaylist, it's contain list of mpmediacollection. tried save parse column keep empty(undefined), , type of column on parse array. how can properly?

here code:

let user = pfuser.currentuser()  var theplaylistdata: nsdata = nskeyedarchiver.archiveddatawithrootobject(theplaylist)  user?.setobject(theplaylistdata, forkey: "userplaylist") 

any comment or advice great.

from parse documentation:

we not recommend storing large pieces of binary data images or documents using nsdata fields on pfobject. pfobjects should not exceed 128 kilobytes in size. store more, recommend use pffile. see guide section more details.

you can use pffile:

 var theplaylistdata: nsdata = nskeyedarchiver.archiveddatawithrootobject(theplaylist)  var music= pfobject(classname:"music")  music["userplaylist"] = theplaylistdata  jobapplication.saveinbackground() 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -