2011/11/08

Master-Detail Applicationの遷移

iOS5標準テンプレートMaster-Detailのmasterのセルを選択した時のメソッド

-(void)tableView:(UITableView *)tableView 
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
      DetailViewController *detailVC = 
      [self.storyboard instantiateViewControllerWithIdentifier:@"Detail"];

      [self.navigationController pushViewController:detailVC animated:YES];
      detailVC.detailDescriptionLabel.text =
      [NSString stringWithFormat:@"This is a Row %d", (indexPath.row + 1)];
}