My app works fine in ios 6.But when i upgrade my app to ios 7, view controller is not rotating.I have set rootviewcontroller to mainviewcontroller. self.window.rootViewController=mainViewcontroller; What change in ios 7 make my app to not rotating..?
This the code I have tested in xcode 4.6 and xcode5-DP6
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
}
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = navigationController;//self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
In ViewController I have inserted below methods for testing
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
NSLog(@"rotated");
}
By using above code there is nothing problem in rotation. Its perfectly rotating in all directions.
Check your orientation methods to overcome this problem or post some code snippet.
Note: I have created sample appication in Xcode4.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With