2016-05-26 6 views
1

私はユーザーのまともな量に影響を与えたバグの原因を突き止めるのに苦労しています。私はswift 2.0を使用していて、クラッシュ・スティックをペアにしていますが、クラッシュ・レポートは私を無知にしています。 :一般的なSwift Crashlyticsのバグの修正

EXC_BREAKPOINT 0x00000000e7ffdefe

NewGroupShareInstructionsViewController.swiftライン48 NewGroupShareInstructionsViewController(dismissImageView(UIGestureRecognizer) - >())(閉鎖#1)

ここでは、関連するコード(もしあれば私に知らせています。もっと欲しい)

@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() 
      } 
     } 

    } 

誰かが私にこれを理解するのを助けることができます願っています!

おかげ

答えて

0

あなたは(!)に行くアンラップ力をたくさん持っています。私は代わりにif letステートメントを使用するように切り替えることをお勧めします - これらのアンラップのいずれか1つがクラッシュを引き起こしている可能性があります。私の最高の推測は、ログには最初の封鎖があると言われているので、それはself.lastButtonPressed!の呼び出しであるということです。

+0

お試しいただきありがとうございます! – royherma

関連する問題