0

テーブル ビューで項目が選択されたときに、アプリが応答しません。アプリのデリゲート (dataSource や TitleForHeaderAtSection などのテーブル関数) からすべてを実行していますが、これらはすべて正常に呼び出されています。ただし、リスト内の項目をタップすると、選択方法が呼び出されません。念のため、NSLog も表示します。

これが私のコードです:(かなり長くて広範で、そこにある必要のないがらくたがあることは知っていますが、必要な場合に備えてすべてを入れています...)

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

 {
 NSLog(@"Selected Row.", @"");
 //Get the selected country
 [tableView deselectRowAtIndexPath:indexPath animated:NO];
 NSDictionary *dictionary = [data objectAtIndex:indexPath.section];
 //NSArray *array = [dictionary objectForKey:@"My Wishlists"];
 //NSString *selectedWishlist = [array objectAtIndex:indexPath.row];

 //Initialize the detail view controller and display it.
 WishlistDetailView *dvController = [[WishlistDetailView alloc] initWithNibName:@"WishlistDetailView" bundle:[NSBundle mainBundle]];
 dvController.selectedWishlistId = [wishlistids objectAtIndex:indexPath.row];
 NSLog(@"Selected row with wishlist id: %@", dvController.selectedWishlistId);
 [[self navController] pushViewController:dvController animated:YES];
 [dvController release];
 dvController = nil;
}

コードはエラーなしでコンパイルされます。

いつもお世話になっております!!

クリスチャン・スチュワート

(ちなみに、選択可能なチェックボックスの両方がインターフェイスビルダーでチェックされています。)

4

1 に答える 1

0

tableView:didSelectRowAtIndexPath:UITableViewDelegate方法です。テーブルビューのデリゲートをコントローラーにしていますか?

于 2010-08-27T20:53:07.367 に答える