UIImage and CoreData

Hi everyone,


I have a trouble to fund a tutorial who can help me to save an image to my core data and retrieve it. All tutorial I fund include a tableView, and I use only a viewController.


the big idea isthe App user enter some data and a picture from the library of the camera (pickerController)

So I already have a code running where I save and retrieve my data see below


Retrieve data code

let appDel:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
        let context:NSManagedObjectContext = appDel.managedObjectContext!
     
        let request = NSFetchRequest (entityName: "List")
        request.returnsObjectsAsFaults = false;
     
        request.predicate = NSPredicate (format: "keynumber = %@", KeyNumber.text!)
     
        var results:NSArray = context.executeFetchRequest(request, error: nil)!
     
        if results.count > 0 {
            for user in results{
                var thisUser = user as! List
                println("The Users username is \(thisUser.keynumber)")
             
                /
             
                AircraftID.text = thisUser.aircraftid
                    etc...


save data code

        let appDel:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
        let context:NSManagedObjectContext = appDel.managedObjectContext!
       
        let ent = NSEntityDescription.entityForName("List", inManagedObjectContext: context)
       
       
        var newUser = List (entity: ent!, insertIntoManagedObjectContext: context)
        newUser.keynumber = KeyNumber.text!
       
        newUser.aircraftid = AircraftID.text
          etc...


Can Someone help me?


Thank you

UIImage and CoreData
 
 
Q