Skip to content

Instantly share code, notes, and snippets.

@inonb
Created July 8, 2012 02:42
Show Gist options
  • Select an option

  • Save inonb/3069083 to your computer and use it in GitHub Desktop.

Select an option

Save inonb/3069083 to your computer and use it in GitHub Desktop.
[iOS] テーブルビューの遷移
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// セルのタイトルを取得
NSString *name;
if (indexPath.row == 0) {
name = @"name01";
} else if (indexPath.row == 1) {
name = @"name02";
} else if (indexPath.row == 2) {
name = @"name03";
}
self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
self.detailViewController.detailItem = name;
[self.navigationController pushViewController:self.detailViewController animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment