これは、ProfilTableViewController.m のテーブル ビュー デリゲートの If ステートメントの抜粋です。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *currentCell =(UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
// Navigation logic may go here. Create and push another view controller.
if (currentCell.textLabel.text==@"phrase") {
MainViewController *phraseViewController =[[MainViewController alloc] initWithNibName:@"mesPhrase" bundle:nil];
[self.navigationController pushViewController:phraseViewController animated:YES];
}
ストーリーボードで、ProfilTVC のセルから MainViewController へのプッシュを作成し、TableViewController を「MainViewController」に変更しました。
アプリを実行すると、ProfilViewController のセルをクリックしても何も起こりません:/ wtf?
乾杯、ルイ