0

I'm a new guy in this field

and i have a problem when i addSubView in AppDelegate

i have a Custom Controller look like this:

@interface mainViewController : UIViewController <UITableViewDelegate> 
{
    UITabBarController *myTad;
    UITableView *myTable;
    aModel *myModel
    // ......
}
//Some methods and @property

All i want is make a View Controller that gets other Controller also connect to the model. this is the place work all the things

and in AppDelegate i added in proper way.

[window addSubview: myController.view];
[window makeKeyAndVisible];
return YES

but its just didn't work ?

The Problem is loadView, the method i overWrite in mainViewController implement not do anythings. It's just go through

didn't i miss something?

Max Ng
  • 162
  • 1
  • 2
  • 8

2 Answers2

2

You need to push your new view controller onto the stack, like so:

[self.navigationController pushViewController:myController];
Matt Meyers
  • 143
  • 6
0

Use a UINavigationController to control and 'connect' your views. This will allow you to push them properly and navigate back via back button.

lohiaguitar91
  • 522
  • 5
  • 9