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 count开发者_开发问答ry
[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.)
tableView:didSelectRowAtIndexPath:
is a UITableViewDelegate
method. Is you controller the delegate of the table view?
精彩评论