I have this code in a table view controller (and delegate):
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { DetailStatus *detailViewController = [[DetailStatus alloc] initWithNibName:@"DetailStatus" bundle:nil status:[mStatuses objectAtIndex:indexPath.row]]; [[self navigationController] pushViewController:detailViewController animated:YES]; [detailViewController release]; [self.tableView deselectRowAtIndexPath:indexPath animated:NO]; NSLog(@"exiting didselectrow"); }
And in my DetailStatus class:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil status:(NSDictionary *)pStatus { NSLog(@"I am being called %d", [pStatus objectForKey:@"id"]); self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) {
The funny thing is that my DetailStatus is actually initialized, it even displays "I am being called 000001" in the console window, but it is strange that the view does not appear in the table view ...
I checked the nib name and everything is fine. I checked the DetailStatus header file, it looks fine (for example):
@interface DetailStatus : UIViewController {
So does anyone know why the view will not be clicked on the window, even if I initialized and clicked it?
UPDATE: I tried to write some debugging messages to viewDidLoad in DetailStatus, and it seems that the view does not load even if the class was created ... I wonder why.
UPDATE2: I have a feeling that it could be my navigation manager organization, which is wrong. I have the following:
Login page -> customtabbar -> First table view -> DetailStatus -> Second table view -> DetailStatus
I think that I support only one navigation controller in this hierarchy. I have never created other navigation controllers. I just click scan after another.
Thanks everyone for the answers! I will hand out the award soon, I will let other people vote first before the deadline.