When I take the image from the camera, it gives an error on the console in ios7.I tried first without adding Thread.sleep (3000) to the code, but this also does not work.
full error: A snapshot of a snapshot that was not displayed results in an empty snapshot. Make sure your view has been viewed at least once before the snapshot or snapshot after screen updates.
the code:
public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. PictureFromCameraButton.TouchUpInside += PictureFromCameraButton_Click; } private void PictureFromCameraButton_Click (object sender, EventArgs e) { try { Thread.Sleep (4000); ImagePickerController.SetSourceType(UIImagePickerControllerSourceType.Camera); this.PresentViewController (ImagePickerController, true, null); } catch (NotSupportedException exception) { //Logging Exception in Flurry FA.Flurry.LogError(exception.GetType().Name,exception.Message, new NSError(NSError.CocoaErrorDomain,3584)); BeginInvokeOnMainThread (() => { UIAlertView ErrorAlert = new UIAlertView ("Device unsupported", "Your device does not support this feature", new UIAlertViewDelegate (), "OK"); ErrorAlert.Show (); }); } catch (Exception ex) { //Logging Exception in Flurry FA.Flurry.LogError(ex.GetType().Name,ex.Message, new NSError(NSError.CocoaErrorDomain,3584)); this.ShowErrorInProcessingAlertView (); } }
Mahesh bansode
source share