问题
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,
回答1:
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.
回答2:
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
回答3:
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
来源:https://stackoverflow.com/questions/38741519/if-were-in-the-real-pre-commit-handler-we-cant-actually-add-any-new-fences-due