Ios 线程1:swift中的EXC_断点(代码=1,子代码=0x1cd595b2c)

Ios 线程1:swift中的EXC_断点(代码=1,子代码=0x1cd595b2c),ios,swift,mobile,Ios,Swift,Mobile,我有一个swift项目。当我点击按钮时,应用程序正在崩溃 func shareRide() { if let currentLocation = currentLocation.value { let format = "http://maps.google.com/maps?q=loc:\(currentLocation.latitude),\ (currentLocation.longitude)"

我有一个swift项目。当我点击按钮时,应用程序正在崩溃

func shareRide() {

          if let currentLocation  = currentLocation.value {

          let format = "http://maps.google.com/maps?q=loc:\(currentLocation.latitude),\ 
                       (currentLocation.longitude)"

          let  message = "\(AppName) :- \(String.removeNil(User.main.firstName)) \. 
                         (String.removeNil(User.main.lastName)) \. 
                         (Constants.string.wouldLikeToShare) \(format)"


          self.share(items: [#imageLiteral(resourceName: "Splash_icon"), message])   *Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1cd595b2c)*

    }
}


func share(items : [Any]) {

    let activityController = UIActivityViewController(activityItems: items, applicationActivities: nil)
    activityController.excludedActivityTypes = [.airDrop]

    if let popoverController = activityController.popoverPresentationController {
        popoverController.sourceRect = CGRect(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height / 2, width: 0, height: 0)
        popoverController.sourceView = self.view
        popoverController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
    }
    self.present(activityController, animated: true, completion: nil)
}
shareRide()是在点击按钮时调用的方法


谢谢,期待您的回答

如果您确定
格式
消息
不是
nil
,那么您的图像文字(飞溅图标)可能是
nil


尝试暂时删除它以验证这一点。

在shareRide()方法中,格式和消息不是零。带有“Splash_图标”的资源也不是零?你查过了吗?对不起,还没有,我很乐意帮忙,@S.kingstar!如果答案有助于解决你的问题,请投赞成票。