3

Good day.I simply created an view which opens gallery picker for a user and user chooses an image.I have to keep track of chosen images and save them for a use till the app uninstalled.The problem is that im using core data to save the necessary info and for me the logical would be to save the image path so later i could get the core data,get all image paths and show them inside image view.The problem is that i receive NSURL from image picker by this code

func imagePickerController(picker: UIImagePickerController!, didFinishPickingImage image: UIImage!, editingInfo: NSDictionary!){


    self.dismissViewControllerAnimated(true, completion: { () -> Void in
            let path   = editingInfo.valueForKeyPath("UIImagePickerControllerReferenceURL") as! NSURL


             self.imageView?.image = UIImage(named:path.absoluteString);
        })

    }

and as you can see im trying to apply the image by the path to UIImage.Nothing happens...image view is fully and clearly empty....and i have no clue what i can do to get the image loaded by its gallery path..In android its very easy by gettting bitmap through image path but here its seems impossible?Please help me...Thank you...

One more strange thing...as googlign i found this code to get the pat above but here is the path im getting and why something tell`s me the path should not be like this......

assets-library://asset/asset.PNG?id=5FBCA5A4-06CC-4469-8D0C-B86E7AEE9FCA&ext=PNG
19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.