我的应用程序在UIDocumentPickerViewController上崩溃了 [英] My app is getting crashed on UIDocumentPickerViewController

查看:1298
本文介绍了我的应用程序在UIDocumentPickerViewController上崩溃了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在iOS App上进行文件共享,我是 UIDocumentPickerViewController 的新手。我不知道为什么我的应用程序崩溃。

  UIDocumentPickerViewController * documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@ [@public .image] inMode:UIDocumentPickerModeImport]; 
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];

应用程序在突出显示的行上崩溃。



<有没有人以前做过这个?我想像下面的附件那样做

Apple文档:


在您的应用程序可以使用文档选择器之前,您必须在Xcode中打开
iCloud Documents功能




让我知道这是否可以解决您的问题!


I am working on file sharing on my iOS App, I am new to UIDocumentPickerViewController. I do not know why my app is crashing.

UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];

App is crashing on the highlighted lines.

Has anyone done this previously? I want to do the same like the attachment below

解决方案

See Prerequisite section on Apple Documentation:

Before your app can use the document picker, you must turn on the iCloud Documents capabilities in Xcode

Let me know if this solve your problem!

这篇关于我的应用程序在UIDocumentPickerViewController上崩溃了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆