天天看点

页面跳转问题presentViewController

跳转页面的时候 我用的是 [self presentViewController:nLogin animated:NO completion:^{

    }];,有A到B再到C,我现在再C页面返回的时候我想直接跳转到A页面 应该怎么做呢?

在C中

//关掉自己

    [self

dismissViewControllerAnimated:YES

completion:^(){

        //关掉注册controller

        [[NSNotificationCenter

defaultCenter] postNotificationName:NOTIFICATION_CLOSE_B

object:nil

userInfo:nil];

    }];

在B中添加监视通知

[[NSNotificationCenter

defaultCenter] addObserver:self

selector:@selector(close)

name:NOTIFICATION_CLOSE_B

object:nil];

-(void) close{

 [self dismissViewControllerAnimated:YES completion:nil];

}