this question has answer here:
hi i'm trying storing array of images using swift not working
i use saving
let defaults = nsuserdefaults.standarduserdefaults() defaults.setobject(photos, forkey: header) defaults.synchronize()
and loading
if let items = defaults.arrayforkey(header) { self.photos = self.photos + items }
if photos
array of uiimage, code nothing:
defaults.setobject(photos...)
the reason uiimage not property list type. defaults
property list. see apple's docs:
Comments
Post a Comment