NSInteger index = (NSInteger)[[self.navigationController viewControllers] indexOfObject:self];
if (index > 2) {
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:(index-2)] animated:YES];
}else{
[self.navigationController popToRootViewControllerAnimated:YES];
}
网友评论