views:

50

answers:

1

Hello!

I'm having trouble having my app respond when an Item is selected in the table view. I'm running everything from my app delegate (the table functions that is like dataSource and TitleForHeaderAtSection etc) which are all being called fine. However it is not calling my selection method when I tap on a item in the list. I even put a NSLog to see just in case.

Here's my code: (its quite long and extensive and I know theres crap in there that doesn't need to be there but I put all of it just in case you needed it...)

- (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;
}

The code compiles with NO errors.

Thanks for your persistant help!!

Christian Stewart

(by the way both of the selection allowed checkboxes are checked in Interface builder.)

A: 

tableView:didSelectRowAtIndexPath: is a UITableViewDelegate method. Is you controller the delegate of the table view?

amrox
Wow I accidentally forgot to set the delegate for the table view. Thanks so much!
Christian Stewart