Search code examples
iphoneuitableviewpushviewcontroller

UITableView not pushing the Detail View!


losing sleep over this issue

My app hierarchy is ListVC1-->ListVC2-->DetailVC. [Working perfect]

and... SearchListVC-->DetailVC (the same DetailVC as above) [Issue is in this model]

The code in SearchListVC is almost same as ListVC2, with a difference that it contains a SearchBar, instead of a navigationBar, on top.

Also, please note that I am able to present the DetailVC as a ModalView, it is push that is not happening... the cell remains highlighted.

Here is the didselectrow code

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// Navigation logic may go here. Create and push another view controller.
if (indexPath.row<[smses count]) {
    WebSMSDetailViewController *detailViewController = [[WebSMSDetailViewController alloc] initWithNibName:@"WebSMSDetailViewController" bundle:nil];

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

    detailViewController.smsList = allWebSMSes;
    detailViewController.smsIndex = indexPath.row;
    [detailViewController populateDetails];

    [detailViewController release];
}
else {
    if (indexPath.row<totalSMSes) {
        pageNumber++;
        [self loadNotes];
    }
}}

I think the problem is somewhere else. I have been googling for quite a while but couldn't understand the solutions posted, so please be a little descriptive... beginner here!


Solution

  • I suppose the problem is that, you dont have a navigation controller in the SearchListVC. Like you wrote,

    it contains a SearchBar, instead of a navigationBar, on top

    Use a navigation controller with the SearchListVC and I think your problem is solved.

    Cheers