tags:

views:

55

answers:

2

I am having problems with getting a detail view to load using pushViewController. At first, I thought pushViewController was not working. BUT, then I tried using a different view controller and it worked. I can tell from tracing that the problem view controller is never loaded at all. In other words, I tried to eliminate the possibility that there was some error in the view controller by NSLoging in that object and I never see anything.

Does anyone have any ideas?

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

/*  
    NSLog(@"hsitkjsdfkljlkd");

    if (childController == nil)
        childController = [[salesViewController alloc] initWithNibName:@"salesView" bundle:nil];

    //NSUInteger row = [indexPath row];

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

 */

/*  

    //modal = blocking
    salesViewController *otherVC = [[salesViewController alloc] initWithNibName:@"salesView" bundle:nil];

    //must set sale type
    otherVC.strSaleType = @"Voice";

    [self presentModalViewController: otherVC animated:YES]; 

    //No close. By design, it is up to the otherVC to close itself  

    */

    //tipCalcViewController *detailViewController = [[tipCalcViewController alloc] initWithNibName:@"tipCalcView" bundle:nil];
    salesViewController *detailViewController = [[salesViewController alloc] initWithNibName:@"salesView" bundle:nil];
    // ...
    // Pass the selected object to the new view controller.

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


}
A: 

just try it......Surely it will work for u...

salesViewController *detailViewController = [[salesViewController alloc] initWithNibName:@"salesViewController" bundle:nil]; // ... // Pass the selected object to the new view controller.

[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release]; 
Ajay Sharma
A: 

Just Check the

  • (void)viewWillAppear:(BOOL)animated{

}

of the salesViewController.

you are doing something wrong in this..

put the debugging point in the viewWillAppear and run it. you can get the error line..

RakeshBhatt