I’m developing ios 6 application and need to switch between 2 views.
I’ve done it for ios 5 in this way:
-(IBAction)BtnClicked:(id)sender
{
MainViewController* mainView = [[MainViewController alloc] initWithNibName:nil
bundle:nil];
mainView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:mainView animated:NO];
}
But for ios 6 xcode asks that presentModalViewController is deprecated.
So how to do this stuff?
Please help.
Read the UIViewController documentation, the deprecated methods and their replacements are listed right there.
presentModalViewController:animated:
Presents a modal view managed by the given view controller to the user. (Deprecated in iOS 6.0. Use presentViewController:animated:completion: instead.)
check official page