samedi 7 novembre 2015

Save and retrieve ALAsset from sqlite DB in swift

I want to save images assets in sqlite DB and get back asset from DB. I am trying to save ALAsset in DB but not able to reload back as ALAsset. Is it possible to change ALAsset to String and String back to ALAsset ?

   var asset : ALAsset = (assets as NSArray).objectAtIndex(i) as! ALAsset

this asset I'm saving in DB and retrieving back using

var tempDict : NSDictionary = self.chosenImages.objectAtIndex(indexPath.row) as! NSDictionary
var asset : ALAsset = tempDict.objectForKey("asset") as! ALAsset

Aucun commentaire:

Enregistrer un commentaire