Grab an Image from an Image view and place it in the documents folder
===

So the user clicks this button and it will load up a UIImagePickerControllerSourceTypePhotoLibrary.
Once the user chooses the image, it will be displayed in an ImageView. How do I take that image displayed in the image view and save it to the Documents folder?

I tried this but no image shows up.

        NSData *pngData = UIImagePNGRepresentation(baseImagee);
    NSArray *pathsss = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsssPath = [pathsss objectAtIndex:0]; //Get the docs directory
    NSString *filePath = [documentsssPath stringByAppendingPathComponent:@"Icon.png"]; //Add the file name
    [pngData writeToFile:filePath atomically:YES]; //Write the file
    iconimage.image = baseImagee;

iconimage is my image view. baseimagee is my iboutlet uiimage declared in my .h.


Thanks!