segue没有使用swift

时间:2014-06-21 09:41:00

标签: ios iphone objective-c uitableview swift

由于某些原因,我无法转换到detailViewController。它适用于我不使用tableView的地图。这是我用于segue的代码,这里是whole project

override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {

        let detailViewController: DetailViewController = segue.destinationViewController as DetailViewController

        detailViewController.Name = self.index

    }

1 个答案:

答案 0 :(得分:0)

快捷键4

performSegue(withIdentifier: "segueID", sender: self.index)

-

override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if segue.identifier == "segueID" {
    if let vc = segue.destination as? DetailViewController {
        vc.Name = sender as! [String]
        }
    }
}