performSelectorOnMainThread with performSegue

时间:2016-01-22 00:14:18

标签: multithreading swift segue

我一直在寻找这个问题的答案,但还没有找到。我有一个看起来像这样的方法

dispatch_async(dispatch_get_main_queue()) {
    self.performSegueWithIdentifier("ShowNextView", sender: nil)
}

是否有可能以某种方式将performSelectorOnMainThread用于此目的?我可以看到performSelectorOnMainThread on接受一个参数。

2 个答案:

答案 0 :(得分:0)

您是否尝试将发件人设置为self而不是nil?

dispatch_async(dispatch_get_main_queue(),{
    self.performSegueWithIdentifier("ShowNextView",sender: self)
})

答案 1 :(得分:0)

你试过这个吗?

add_file_log