views:

62

answers:

1

I've got a UINavigationController that has a UITableViewController as it's root view. The UINavigationController is inside a UITabBarController.

In the UITableViewController (*viewOne), if I click a cell a the following code runs

UIViewController *newView = [[UIViewController alloc] initWithNibName:@"newView" bundle:nil];
[self.navigationController pushViewController:newView animated:YES];
[newView release];

Then, inside of newView is:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {

        NSLog(@"%@", self.navigationController);

    }
    return self;
}

The logs have:

[8947:207] (null)

And if I try to push a new view controller to the navigationController, nothing happens. Any clues?

A: 

I've figured it out.

In my application delegate, I've added a new property:

UINavigationController *profileNavigationController;
@property (nonatomic, retain) IBOutlet UINavigationController *profileNavigationController;

And in IB, I've connected the profileNavigationController from the app delegate to Navigation Controller.

And now, when pushing new views, I call:

StartDateSelectorViewController *startDateSelectorViewController = [[StartDateSelectorViewController alloc] initWithNibName:@"StartDateSelectorView" bundle:nil];

Strength_EngineAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.profileNavigationController pushViewController:startDateSelectorViewController animated:YES ];
Jared McFarland