0

tableView を使用してアプリを構築しようとしていますが、これまでのところ、tableView が設定されているところまで到達しましたが、行を押しても何も起こりません。どんな助けでも大歓迎です。私に役立つコードが不足している場合は、質問してください。投稿します。

NSLog を使用して、行を押すとアクションが呼び出されると判断しましたが、次の viewController はプッシュされません。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSLog(@"DidSelectRow");

   // UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    galleriaDetailViewController *galleriaDetail = [[galleriaDetailViewController alloc] initWithNibName:@"galleriaDetail" bundle:nil];
    [self.navigationController pushViewController:galleriaDetail animated:YES];


}

ありがとうございました!

4

2 に答える 2

1

あなたのコメントから、あなたがストーリーボードを使用していることがわかりました。ストーリーボードの手段を使用している場合、なぜペン先にアクセスしようとしているのか.

このコードを試してください

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSLog(@"DidSelectRow");

   // UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    galleriaDetailViewController *galleriaDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"galleriaView"]; // galleriaView is a identifier for that view.you have to set in your storyboard
    [self.navigationController pushViewController:galleriaDetail animated:YES];


}
于 2012-04-28T19:34:42.587 に答える
0

代理人を設定しましたか?myTableView.delegate = self;データソースを設定して設定する必要があります。デリゲートは、InterfaceBuilderまたはプログラムで接続できます。

于 2012-04-28T19:07:07.820 に答える