线程1:信号SIGABRT,没有不完整的插座AFAIK

时间:2018-08-02 06:30:58

标签: ios swift

我是Swift的新手,并且遇到了线程1:信号SIGABRT错误

预期: 我在主视图控制器页面上的元素上使用滑动导航:左(反射),右(目标)和向上(Insights)。

实际: 预期的左右工作;但是,向上触发SIGABRT错误。

我已经阅读了这个StackOverflow thread,并且似乎没有任何不完整的信息,但是我也不清楚每个触发的segue是否需要伴随的呈现segue,或者如果需要,如何添加正确:

Connection Inspector View

下面是视图控制器,称为“ ViewController2”

  

//主要

class ViewController2: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
        leftSwipe.direction = UISwipeGestureRecognizer.Direction.left
        self.view.addGestureRecognizer(leftSwipe)

        let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
        rightSwipe.direction = UISwipeGestureRecognizer.Direction.right
        self.view.addGestureRecognizer(rightSwipe)

        let upSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
        upSwipe.direction = UISwipeGestureRecognizer.Direction.up
        self.view.addGestureRecognizer(upSwipe)


    }

这里是 up 视图控制器,称为“ ViewController3”

  

//洞察力

class ViewController3: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let upSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction(swipe:)))
        upSwipe.direction = UISwipeGestureRecognizer.Direction.up
        self.view.addGestureRecognizer(upSwipe)

    }
  • Insights具有适当的ViewController3类
  • 主要指向ViewController2类
  • 从Main到Insights的情节提要segue标识符被命名为“ goUp”

感谢您的建议和帮助!

1 个答案:

答案 0 :(得分:0)

修复:我没有将多余的Case 4参数(swipeDown)删除,因为我没有将其用于该主视图控制器。

2018-08-01 23:03:09.779549-0700 Kintsugi Mindful Wellness [63589:12403287] ***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'Receiver()与标识符'goDown'没有关联'