Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIPopOverPresentationController在presentationTransitionWillBegin上崩溃_Ios_Swift_Xcode_Crash_Uipopovercontroller - Fatal编程技术网

Ios UIPopOverPresentationController在presentationTransitionWillBegin上崩溃

Ios UIPopOverPresentationController在presentationTransitionWillBegin上崩溃,ios,swift,xcode,crash,uipopovercontroller,Ios,Swift,Xcode,Crash,Uipopovercontroller,我收到苹果公司这样的崩溃: 正如Xcode所预期的那样,崩溃报告是如此糟糕,以至于我不得不猜测在我的代码中这是从哪里来的 坠机事件是关于爆米花的。在我的代码中,只有“共享”这个东西,当我在一个显示文档文件夹中文件的表视图上执行这些“删除”和“共享”拖尾滑动操作时,我才有了popover override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: I

我收到苹果公司这样的崩溃:

正如Xcode所预期的那样,崩溃报告是如此糟糕,以至于我不得不猜测在我的代码中这是从哪里来的

坠机事件是关于爆米花的。在我的代码中,只有“共享”这个东西,当我在一个显示文档文件夹中文件的表视图上执行这些“删除”和“共享”拖尾滑动操作时,我才有了popover

 override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {

    let delete = ... bla bla bla

    let share = UIContextualAction(style: .normal, title: "") {[weak self] (contextualAction, view, boolValue) in
      let oneFile = self?.files![indexPath.section]![indexPath.row]
      
      let activityViewController = UIActivityViewController(
        activityItems: ["Check out these files.", (oneFile?.url)! as URL],
        applicationActivities: nil
      )
      
      activityViewController.popoverPresentationController?.sourceView = self?.view
      self?.present(activityViewController, animated: true, completion: {[weak self] in
        self?.tableView.setEditing(false, animated: true)
      })
    }

    let swipeActions = UISwipeActionsConfiguration(actions: [delete,share])
    swipeActions.performsFirstActionWithFullSwipe = true
    
    return swipeActions
}
你们在这里看到的任何东西都可能导致这次事故吗


报告显示这在iPad上崩溃了,但我测试了一下,它工作正常。

您应该定义
popoverPresentationController的
sourceRect
sourceView
您应该定义
popoverPresentationController的
sourceRect
sourceView