I have an issue while saving UIImage to photo library in device for ios 6.I am able to save the image in simulator but not in device.I have changed the privacy settings for photos in device.Still I am not able to save the image. Below is the code which I am using to save image
UIImage *snap = [sharedSingleton getCopyOfMorphedImage];
NSData* imageData = UIImagePNGRepresentation(snap);
UIImage* pngImage = [UIImage imageWithData:imageData];
UIImageWriteToSavedPhotosAlbum(pngImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if (error != nil) {
NSLog(@"Couldn't save image");
} else {
NSLog(@"Saved image");
}
}
I am getting a black image saved in photo gallery with the above code
Can any one help me out?