Stil facing the problem in Orientation in iphone
- by aman-gupta
Hi,
In my application I have 15 screens in that i m using UIViewController for all screens and in all screens i m using the below way to call other screen :-
AppDelegate *appRefre = (AppDelegate *)[[UIApplication sharedApplication]delegate];
[self.navigationController pushViewController:appRefre.frmReferencesLink animated:YES];
And the below code is activated in all screen for orientation to control the user to switch from one orientation to other mode
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation == UIInterfaceOrientationPortrait)
{
return YES;
}
else
{
return NO;
}
}
But when i run my application in iPhone device my application gets terminated when i physically rotate my iphone device from UIInterfaceOrientationPortrait to UIInterfaceOrientationPortraitUpsideDown or UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight.
And One more things is that when my application lauch i used following code for launching my appliaction :-
1) I made a pointer in mydelegate.h file:
UINavigationController *navigationController;
Then synthesize its property
@property(nonatomic,retain)UINavigationController *navigationController
2) In mydelegat.m
I Wrote
@synthesize navigationController;
(void)applicationDidFinishLaunching:(UIApplication *)application
{
navigationController = [[UINavigationController alloc] initWithRootViewController:DefaultViewLink];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
}
3) In above point DefaultView is launch first and gets remove from view and then actual my appliaction come into picture.
So exactly what i want i want my appliaction to be in portrait mode for all screens i dont want my appliaction will switch to other mode.It remains the same as in portrait mode after rotation to any other mode.
Please help me out its very urgent.
Thanks in Advance and humble request to help me out