9

I am using UIImagePickerController with Camera type. When I first opens the image picker controller it works fine, But after open the image picker vc, when i rotate the device, It shows the "[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction" & there is a white screen with camera image without any options to capture.

It also shows "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."

It is working fine till iOS 9.3, this is happening in iOS10.3 beta.

I will appreciate your help.

Find screenshots here: https://postimg.org/image/qy6k7dc7b/

My Codebase:

UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
pickerController.delegate = self;
[self presentViewController:pickerController animated:YES completion:nil];

Thanks,

shivam
  • 1,148
  • 1
  • 12
  • 28
  • 3
    http://stackoverflow.com/questions/38458170/ios-10-app-if-were-in-the-real-pre-commit-handler-we-cant-actually-add-any – mKane Aug 16 '16 at 16:23
  • same here is there any solution for that? – seggy Sep 27 '16 at 11:25
  • @shivam - did you able to resolve the issue? – nOOb iOS Oct 09 '16 at 09:37
  • @seggy - did you able to resolve the issue? – nOOb iOS Oct 09 '16 at 09:38
  • Showing pickerview on window's rootview controller resolved my issue, try and check once. @nOObiOS – shivam Oct 09 '16 at 10:26
  • UIWindow *window = [UIApplication sharedApplication].keyWindow; UIViewController *rootViewController = window.rootViewController; if (sourceType == UIImagePickerControllerSourceTypeCamera) { [rootViewController presentViewController:imagePickerVC animated:YES completion:nil]; } else { [self presentPopoverFromSender:sender withViewController:imagePickerVC]; } I m finding rootviewcontroller and then presenting it, still issue persists. – nOOb iOS Oct 09 '16 at 10:34
  • It is working now? – shivam Oct 09 '16 at 10:37
  • @shivam - nope. It is not working.. – nOOb iOS Oct 09 '16 at 11:21
  • @shivam i think its not an issue ...just a warning. – seggy Oct 10 '16 at 04:22

3 Answers3

11

This message appears when the orientation of the device changes and is probably some issue from Apple side. A radar has been filed for this issue (Radar Number 28250512) You can ignore the message temporarily, or else, you can disable the logs given by OS by setting the environment variable as described in this answer.

Community
  • 1
  • 1
Sagar D
  • 2,588
  • 1
  • 18
  • 31
3

in your Xcode:

Click on your active scheme name right next to the Stop button

Click on Edit Scheme....

in Run (Debug)-->select the Arguments tab

in Environment Variables click +

add variable: OS_ACTIVITY_MODE = disable

naresh d
  • 183
  • 1
  • 3
  • 8
-2

In Your Xcode Project Go to the Top of the screen you see Product Click on the Product and you see Bottom third option Scheme click on the Scheme you see Bottom third option Edit Scheme click on the Edit Scheme then First option is Arguments Passed On Launch and and you see + and - button here click on the + button and Write OS_ACTIVITY_MODE and check this and write bottom option close click on close your error will Remove Enjoy. :p