6
6

More than 5 years have passed since last update.

カスタムセルを使うとsegueが有効にならない?

Posted at

課題

ストーリーボードでは確かに設定しているはずのsegueが、シミュレータで実行されない。セルを選択してもハイライトされるだけで寂しい感じである。

解決方法

どうやらカスタムセルを利用すると、セルからのsegueが無効になるため、追加手順としてdidSelectedRowAtIndexPath:でsegueを発生させる。

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

これで確かに動くことを確認した。

参考

http://www.slideshare.net/satoshianai/xib#btnNext
ありがとうございました。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6