2015-01-28 5 views
0

UITableView를 사용하여 다른보기 컨트롤러로 전환 할 수 없습니다. 내 코드는 아래와 같습니다.Swift - 프로그래밍 방식으로보기 전환 UITableView를 사용하여

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 
     tableView.deselectRowAtIndexPath(indexPath, animated: true) 

     let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) 

     let dashViewController = storyBoard.instantiateViewControllerWithIdentifier("menuView") as DashViewController 
     self.presentViewController(dashViewController, animated:true, completion:nil) 

    } 

enter image description here

내 세포 중 하나를 클릭하고 그냥 아무것도하지! 제발 조언.

+0

당신이 그것을 통해 밟은 뷰 컨트롤러와의 tableview를 할당? didSelect ... 메소드 호출 중입니까? –

+0

didSelectRowAtIndexPath 내부에 무언가를 인쇄하면 클릭 할 때 어떤 출력이 나옵니까? – rakeshbs

+0

기다려, 먼저 해봐. 기다림. –

답변

0

이미 답변을 찾았습니다. UITableViewDelegate을 넣는 것을 잊었습니다.

class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate{ 

} 

그리고

enter image description here