UIImagePickerView
Controller returns NSData
of image,
My requirement is to store the path of an image as a varchar data type.
After selecting an image from UIImagePickerView
, how can I obtain the complete path of the selected image of Photo Gallery of iPhone?
My application won't have to worry about storing images within my application. The images are already stored on the iPhone's photo Gallery.
Thanks in advance.
This is not possible. The UIImagePickerController will give you a
UIImage*
, and you have to convert it intoNSData
yourself, and store it in your local sandbox. There is no SDK-approved way to access the images in the user's photo gallery (for security reasons).Assuming you're using SDK 3.0, here is a function on the return of the picker that will save it to the disk, in your application's documents directory (this should work, though I may have a small mistake somewhere):