【发布时间】:2014-06-22 01:03:29
【问题描述】:
如何在快速关闭中正确引用 self?
dispatch_async(dispatch_get_main_queue()) {
self.popViewControllerAnimated(true)
}
我得到错误:
Cannot convert the expression's type 'Void' to type 'UIViewController!"
我随机尝试:
dispatch_async(dispatch_get_main_queue()) { ()
self.popViewControllerAnimated(true)
}
它奏效了。不知道额外的 () 做什么!有人愿意解释吗?谢谢!
【问题讨论】:
-
如果答案正确,请接受,如果超出您的预期,请点赞。