专门的UIViewController调用使iOS Swift崩溃的某些方法

时间:2018-08-30 12:19:43

标签: ios swift

  1. 我无法复制此问题,如何复制以下架构崩溃?
  2. 有没有办法在xcode中打开此崩溃(将崩溃导入到xcode中)

    Crashed: com.apple.main-thread
    0  ABCC                           0x10092d0c4 specialized ABCViewController.signInBtnPressed(UIButton) -> ()(ABCViewController.swift:178)
    1  ABCC                           0x10092a520 @objc ABCViewController.unwind(UIStoryboardSegue) -> () + 3152641510
    2  UIKit                          0x18aced64c -[UIApplication sendAction:to:from:forEvent:] + 86
    3  UIKit                          0x18ae0e870 -[UIControl sendAction:to:forEvent:] + 52
    4  UIKit                          0x18acf3700 -[UIControl _sendActionsForEvents:withEvent:] + 120
    5  UIKit                          0x18ae291a8 -[UIControl touchesEnded:withEvent:] + 492
    6  UIKit                          0x18b2ceee8 _UIGestureEnvironmentSortAndSendDelayedTouches + 4340
    7  UIKit                          0x18b2cbc60 _UIGestureEnvironmentUpdate + 1236
    8  UIKit                          0x18ad664d8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
    9  UIKit                          0x18ad66010 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
    10 UIKit                          0x18ad65874 -[UIWindow sendEvent:] + 3132
    11 UIKit                          0x18ad641d0 -[UIApplication sendEvent:] + 340
    12 UIKit                          0x18b545d1c __dispatchPreprocessedEventFromEventQueue + 2340
    13 UIKit                          0x18b5482c8 __handleEventQueueInternal + 4744
    14 CoreFoundation                 0x180f27404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    15 CoreFoundation                 0x180f26c2c __CFRunLoopDoSources0 + 276
    16 CoreFoundation                 0x180f2479c __CFRunLoopRun + 1204
    17 CoreFoundation                 0x180e44da8 CFRunLoopRunSpecific + 552
    18 GraphicsServices               0x182e2a020 GSEventRunModal + 100
    19 UIKit                          0x18ae64758 UIApplicationMain + 236
    20 ABCC                           0x1007b28c4 main (main.m:20)
    21 libdyld.dylib                  0x1808d5fc0 start + 4
    

这是崩溃动作的代码。

@IBAction func signInBtnPressed(_ sender: UIButton) {
    sender.isUserInteractionEnabled = false
    guard let employees = UserService.shared.employees, let name = employees.names?[sender.tag] else {
        sender.isUserInteractionEnabled = true  // crashing here
        return
    }
    // perform task
    sender.isUserInteractionEnabled = true
}

0 个答案:

没有答案