1) First, like each of them, give the name of the view controller in the File Owner class
2) Select "File Owner", drag a line from there to view this connection.
3) Create an instance of the View controller and add it to the window so that the code snippet is as follows,
MyViewController *controller = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil];
4) Finally, add the view controller view as a subview to window.TO do this so that the encoding is as follows,
[window addSubview:[controller view]]
Try the following snippet on appdelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after application launch [window makeKeyAndVisible]; MyViewController *controller = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil]; [window addSubview:[controller view]]; }
5) Use the following snippet to increase the window size so that no delays are displayed
[controller.view setFrame:[[UIScreen mainScreen] applicationFrame]];
Now you will see the controller of your kind, as you expected ...
Hope this helps ...
Durai Amuthan.H Apr 05 '13 at 4:51
source share