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.
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
Post a Comment