uiimage - NSUerDefault for saving array of image in swift -


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:

https://developer.apple.com/library/ios/documentation/general/conceptual/devpedia-cocoacore/propertylist.html#//apple_ref/doc/uid/tp40008195-ch44-sw1


Comments