我是iOS
开发的新手。我想问的一件事,当我点击tableViewCell
我想移动到新的viewController
,但当我点击它给我注意。点击tableview单元不能移动到新的控制器
这里是我的代码 -
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let row = indexPath.row
if row == 4
{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let secondViewController = storyboard.instantiateViewControllerWithIdentifier("contact") as! contactsandlists
navigationController?.pushViewController(secondViewController, animated: true)
print("error")
}
请解决我的问题
错误是否打印? –
是错误被打印,但它不会移动到进一步的视图控制器 – Bansal
在故事板,你需要嵌入你的当前控制器与NavigationController –