Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.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 修复了通用的Swift Crashlytics错误_Ios_Swift_Crashlytics - Fatal编程技术网

Ios 修复了通用的Swift Crashlytics错误

Ios 修复了通用的Swift Crashlytics错误,ios,swift,crashlytics,Ios,Swift,Crashlytics,我正在努力找出一个bug的来源,这个bug已经影响了我相当多的用户。我正在使用swift 2.0,并已将crashlytics配对,但崩溃报告让我不知所措!: EXC_断点0x00000000e7ffdefe NewGroupShareInstructionViewController.swift第48行 NewGroupShareInstructionViewController。(DismissionMageView(UIgestureRecognitor)->()。(闭包#1) 这是相关代

我正在努力找出一个bug的来源,这个bug已经影响了我相当多的用户。我正在使用swift 2.0,并已将crashlytics配对,但崩溃报告让我不知所措!:

EXC_断点0x00000000e7ffdefe

NewGroupShareInstructionViewController.swift第48行 NewGroupShareInstructionViewController。(DismissionMageView(UIgestureRecognitor)->()。(闭包#1)

这是相关代码(如果您需要更多,请告诉我)

希望有人能帮我解决这个问题


谢谢

您正在进行大量的强制展开(
)。我建议您改为使用
if let
语句-这些展开中的任何一个都可能导致崩溃。我最好的猜测是,
self.lastbutonpressed调用,因为日志显示它在第一个闭包中,也就是说。

正在进行大量强制展开(
)。我建议您改为使用
if let
语句-这些展开中的任何一个都可能导致崩溃。我最好的猜测是,
self.lastbutonpressed调用,因为日志显示它在第一个闭包中,也就是说

@IBAction func butPreviewPressed(sender: UIButton) {
        let imageView = UIImageView(image: UIImage(named: "Step\(sender.tag)"))
        imageView.frame = self.view.frame
        UIApplication.sharedApplication().keyWindow?.addSubview(imageView)
        imageView.frame = CGRectZero
        imageView.center = sender.center
        let recognizer = UITapGestureRecognizer(target: self, action: "dismissImageView:")
        imageView.addGestureRecognizer(recognizer)
        imageView.userInteractionEnabled = true

        self.lastButtonPressed = sender
        UIView.animateWithDuration(0.25) {
            self.navigationController?.setNeedsStatusBarAppearanceUpdate()
            imageView.frame = UIScreen.mainScreen().bounds
        }
    }

func dismissImageView(recognizer: UIGestureRecognizer) {
        let imageView = recognizer.view!
        UIView.animateWithDuration(0.25, animations: {
            imageView.frame = CGRectZero
            imageView.center = self.lastButtonPressed!.center
        }) { (completed) in
            if completed {
                self.lastButtonPressed = nil
                imageView.removeFromSuperview()
                self.navigationController?.setNeedsStatusBarAppearanceUpdate()
            }
        }

    }