heyho, 我正在尝试仅针对1个Segue开始准备活动。错误在哪里?
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" {
let indexPath = self.tableView.indexPathForSelectedRow()
let post = myCollection[indexPath!.row].id
let controller = segue.destinationViewController as? DetailVC
controller?.thisPost = post
}
}
当然,如果我不做if条款,它会触发VC中的任何一个字段 - 奇怪的是无论如何呢?