UIDeviceOrientationPortrait , ios 6 & 7 , InterfaceOrientation

266 views Asked by At

i have this code i want to go to another uiview but i want to have showing this view (second view) in portrait mode only and the notification in first view doesn't work in second view ;

is there any way to change the for this

   [[NSNotificationCenter defaultCenter] removeObserver:self];

    view2 *viewController = [[[view2 alloc] init] autorelease];
    UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];

    viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:navController animated:NO];

i want exactly one function same this code in ios >6

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    return NO;
}
1

There are 1 answers

2
Srinivas On

Try subclassing the UINavigationController and override the following methods :

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}