pushViewController/presentModalViewController/addSubView区别及使用方法 使用presentModalViewControllerAnimated方法从A->B->C,若想在C中直接返回A,则可这样实现: C中返回事件: 然后在B中,
1. 用UINavigationController的时候用pushViewController:animated----返回之前的视图[[self navigationController] popViewControllerAnimated:YES];---ps:push以后会在navigation的left bar自动添加back按钮,它的响应方法就是返回。所以一般不需要写返回方法,点back按钮即可。2. 其他时候用presentModalViewControll
另加一个//在viewdidload中: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(back) name:@"backback" object:nil]; -(void)back { [self dismissModalViewControllerAnimated:YES]; }