{
[super viewDidLoad]; self.view.backgroundColor=[UIColor grayColor]; self.navigationController.navigationItem.title=@"A"; self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(back1)]; } -(void)back1{ B *b=[[B alloc]init]; b.view.backgroundColor=[UIColor redColor]; UINavigationController *navi=[[UINavigationController alloc]initWithRootViewController:b]; navi.viewControllers=[NSArray arrayWithObjects:b, nil]; [b release]; navi.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:navi animated:YES]; [navi release]; }
- (void)viewDidLoad
{ [super viewDidLoad]; // Do any additional setup after loading the view. self.navigationController.navigationItem.title=@"B"; self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(back)]; } -(void)back{ [self dismissModalViewControllerAnimated:YES]; }