2012-03-25 19 views
0

我知道這是一個簡單的問題,但我找不到答案。那麼,如何通過選擇UITableViewCell以模式切換到新視圖?通過點擊桌面單元切換到模態視圖(新手)

我知道我可以使用這樣的代碼:

if (cell.isSelected) 
    { 
     [self performSegueWithIdentifier:@"someSegue" sender:self]; 
    } 

我就要檢查一下是否該小區是所選擇的一段時間正因爲如此,我不知道在哪裏我UITableViewController我應該使用此代碼。

回答

0

您想實施tableView:didSelectRowAtIndexPath:委託方法。這將在您選擇一行表格視圖時被調用。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    [self performSegueWithIdentifier:@"someSegue" sender:self]; 
} 

更多細節可以在Table View Programming Guide for iOS

找到
相關問題