Got a SIGABRT while executing native code. This usually indicates
a Fatal error in the mono runtime or one of the native librarIEs
used by your application.
我只在Storyboard中的NavigationController中嵌入了一个VIEwController.代码片段如下:
UIImagePickerController imagePicker;public overrIDe voID VIEwDIDLoad(){ base.VIEwDIDLoad(); this.setupImagePicker(); CapturePhotobutton.touchUpInsIDe += delegate { this.AddMedia(); };}public voID setupImagePicker(){ imagePicker = new UIImagePickerController(); imagePicker.sourceType = UIImagePickerControllerSourceType.Camera; imagePicker.ModalPresentationStyle = UIModalPresentationStyle.Popover; imagePicker.MediaTypes = UIImagePickerController.AvailableMediaTypes( UIImagePickerControllerSourceType.Camera); imagePicker.FinishedPickingMedia += HandleFinishedPickingMedia; imagePicker.Canceled += (sender,e) => { imagePicker.dismissModalVIEwController(true); };}public voID HandleFinishedPickingMedia(object sender,UIImagePickerMediAPIckedEventArgs e){ bool isImage = false; switch (e.Info[UIImagePickerController.MediaType].ToString()) { case "public.image": isImage = true; break; case "public.vIDeo": break; } if (isImage) { UIImage originalimage = e.Info[UIImagePickerController.Originalimage] as UIImage; if (originalimage != null) { PrevIEwImageVIEw.Image = originalimage; imagePicker.dismissVIEwController(true,null); } }}public voID AddMedia(){ //Crashes on this line this.NavigationController.PresentVIEwController(imagePicker,true,null);}解决方法 为您的info.pList添加了隐私 – 相机使用说明,解决了问题 总结
以上是内存溢出为你收集整理的ios – 呈现UIImagePickerController会崩溃应用程序全部内容,希望文章能够帮你解决ios – 呈现UIImagePickerController会崩溃应用程序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)