I was wondering how to make a UITableView go to a different ViewController when you press a cell. So far I have this code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
}
}
It goes something like this:
WARNING: Just typed the above without looking at any documentation — if it doesn’t compile after you substitute your own view controller class name for
SomeViewController, look for misspellings and such.BTW, there’s quite a bit of documentation on this topic, and plenty of examples too. If the snippet above doesn’t solve your problem, take a look at the View Controller Programming Guide for iOS.