IOS8 Snapshot of a snapshot that was not displayed leads to the creation of an empty snapshot

So, I know this has been given several times, but I have yet to find a solution that works for me.

The odd thing is that the first time I present a camera from the UIPickerController, it works just fine, exactly as intended. But then, if I open it again, it will only display a black screen with camera controls (the Cancel button and the White Snapshot button).

Any help overwhelming this error would be greatly appreciated, or even just a confirmation that it is a mistake, and I just need to wait until Apple decides that it will be a big help!

Thanks everyone :)

(PS I am working on iPhone 6 Plus using iOS 8.1)

EDIT: Code (I use Xamarin and C #)

public void ShowPhotoTaker (UIViewController vc) { UIImagePickerController picker = new UIImagePickerController (); picker.SourceType = UIImagePickerControllerSourceType.Camera; picker.FinishedPickingMedia += (object sender, picker.DismissViewController(true, null); }; picker.Canceled += (object sender, EventArgs e) => { picker.DismissViewController(true, null); }; vc.PresentViewController (picker, true, null); } 

And this is the exact error I get when calling this method

 Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates. 
+3
source share
2 answers

I also had this error. I contacted Xamarin Support and they told me that this is a bug with iOS 8 and above. There is no solution for this, except for the expectation of any deployment fix for iOS development, or possibly Xamarin itself. A workaround may be to install the build SDK in an earlier version and clean + rebuild your application.

+1
source

A snapshot of an image that has not been rendered results in an empty snapshot error .

This is definitely a mistake, and you can find it on the apple developer forums as well.

I tried to avoid this error using many other stack overflow answers, but could not fix this problem. However, using this, I might somehow not get this error, I would not call it a fix, but try and let me know if this fixed the problem.
Disconnect the view controller using the Central Central Dispatch asynchronous call from the main queue, fixed the problem for me.

 -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // Code to handle the image data dispatch_async(dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:YES completion:nil]; }); } -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { dispatch_async(dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:YES completion:nil]; }); } 
0
source

All Articles