Reputation: 174
I'm trying to build an app with a tableView and so far I have made it to the point where I have a populated tableView, but I can't get anything to happen when I press the rows. Any help would be appreciated. If you are missing some code to help me just ask and I will post it.
With NSLog I have determined that the action is called when I press a row, but the next viewController isn't pushed.
- (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];
}
Thank you!
Upvotes: 0
Views: 232
Reputation: 8501
From your comments i have found out that you are using storyboard.If you are using storyboard means,then why you are trying to access a nib.
Try this code
- (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];
}
Upvotes: 1
Reputation: 3701
Did you set your delegates? You need to set myTableView.delegate = self;
and the set the datasource. You can hook up the delegate in interface builder or programmatically.
Upvotes: 0