tarheel
tarheel

Reputation: 4797

Why wont my segue from UITableView cell to a detailView work?

Here is my code.....

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

[tableView deselectRowAtIndexPath:indexPath animated:NO];

[self performSegueWithIdentifier:@"BowlerDetail" sender:self];
}

All I get in return is that the cell is still selected, and my detail view does not show up. Yes, I have checked, and "BowlerDetail" is the name of the segue. The error message I get is - 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "tc8-Hk-kaK-view-YJA-Me-wti" nib but didn't get a UITableView.'.

Any help is appreciated.

Edit: In the pre-xCode 4.2 days, this is how I previously achieved the objective here.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];

DetailView *detailVC = [[DetailView alloc] initWithNibName:nil bundle:nil];

[self.navigationController pushViewController:detailVC animated:YES];


[detailVC release];
}

Upvotes: 2

Views: 6076

Answers (3)

Bongani Ntila
Bongani Ntila

Reputation: 31

The problem is that you used a push segue and you didn't use a UINavigationController as a root view controller.So add a UINavigationController as a root view Controller or change the segue to modal.

Upvotes: 3

Krizz
Krizz

Reputation: 11552

If you do not need to perform a segue programatically, you can connect your cell's prototype in IB by option-clicking the cell and dragging the "Modal" segue to the view you want to present.

And with your code? Is this method inside the view that is visible when starting a segue? Are both views in storyboard?

Upvotes: 1

SentineL
SentineL

Reputation: 4732

[tableView deselectRowAtIndexPath:indexPath animated:NO];. You calling this method from itself. is that you whant? i think you should remove this.

Upvotes: 0

Related Questions