Hi experts,
In my universal app, this is the order in which i load views, when my app loads
AppDelegate to FirstVIEW - didFinishLaunchingWithOptions event
FirstVIEW to LOGINVIEW
Once i finish doing pre-login stuff, i navigate to Login view
LOGINview to MAINViewWithTabControllers
Once i finish doing authentication after login, i navigate to main view, where i have 3 tabs, 2 tabs have a splitview controllers in em. (iPad)
My questions are,
a) every time i add a view, do i have to use 'myAppDelegate.window' and then invoke the addsubview() method or can we use '[self addSubview]'?
b) while removing the main view, do i have to remove the others views, before adding the main view?
This kind of navigation is causing all sorts of issues on orientation change on the iPAD, even though all the view controllers return 'YES' in 'shouldAutorotateToInterfaceOrientation' event.
In my universal app, this is the order in which i load views, when my app loads
AppDelegate to FirstVIEW - didFinishLaunchingWithOptions event
Code:
[window addSubview:VIEW1];
[window makeKeyAndVisible];
FirstVIEW to LOGINVIEW
Once i finish doing pre-login stuff, i navigate to Login view
Code:
LoginViewController_iPad *lsvc = [[LoginViewController_iPad alloc] initWithNibName:@"LoginViewController_iPad" bundle:Nil];
SDEAppAppDelegate_iPad *myAppDelegate = (SDEAppAppDelegate_iPad *) [[UIApplication sharedApplication] delegate];
[lsvc.view setFrame:[[UIScreen mainScreen]applicationFrame]];
[myAppDelegate.window addSubview:lsvc.view];
LOGINview to MAINViewWithTabControllers
Once i finish doing authentication after login, i navigate to main view, where i have 3 tabs, 2 tabs have a splitview controllers in em. (iPad)
Code:
Code:
//Remove the login view and the pre-login view
while([[myAppDelegate.window subviews] count])
{
[[myAppDelegate.window subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
}
//Adding the tab bar main view
[myAppDelegate.window addSubview:myAppDelegate.myTabBarController.view];
[myAppDelegate.window makeKeyAndVisible];
My questions are,
a) every time i add a view, do i have to use 'myAppDelegate.window' and then invoke the addsubview() method or can we use '[self addSubview]'?
b) while removing the main view, do i have to remove the others views, before adding the main view?
Code:
Code:
//Remove the login view and the pre-login view
while([[myAppDelegate.window subviews] count])
{
[[myAppDelegate.window subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
}