動的セルがUITableViewController
あり、誰かがセルをタップしたときに特定のViewControllerをプッシュしたいと思います。だから私は既成の方法を使おうとしています
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
しかし、シミュレーターに入ってセルをタップすると、次のようになります。
"NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle [...] with name 'AffichageVotesQuestionDuMomentViewController'.
メソッド内で、私はこれを持っています:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
AffichageVotesQuestionDuMomentViewController *detailViewController = [[AffichageVotesQuestionDuMomentViewController alloc] initWithNibName:@"AffichageVotesQuestionDuMomentViewController" bundle:nil];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
}
AffichageVotesQuestionDuMomentViewController
自分で作成したカスタムビューコントローラです。また、別のランダムなものを作成しようとしましたが、同じタイプのエラーが発生します。に設定するinitWithNibName:
とnil
、ナビゲーションバーが上部にあるビューコントローラーになりますが、完全に黒です。
今、私は初心者のiPhoneプログラマーであり、ペン先やペン先の名前などについての理解が非常に乏しいです。どんな助けでも大歓迎です。また、プログラムでView Controllerを作成し、そのようにプッシュしているように見えるため、ストーリーボードなどでセグエを実行しませんでした。セグエでそれを行う良い方法があれば、私もそれで大丈夫です(しかし、タップされたセルの行を知る必要があります)。
ありがとうございました!