单击 mapkit 注释时,我当前添加了一个新 View :
-(IBAction)showDetails:(id)sender{
DetailViewController *dvc = [[DetailViewController alloc] init];
dvc.title = ((UIButton*)sender).currentTitle;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:dvc];
[self presentModalViewController:navigationController animated:YES];
}
我想做的是在新 View 上有一个后退按钮,它将删除 View 并再次显示 mapkit。
我在普通应用程序中使用标签栏。我在新 View 上设置了一个按钮并尝试了这个:
- (IBAction)backToMap:(id)sender {
UINavigationController *nc = [self navigationController];
NSLog(@"%@", [nc viewControllers]);
[nc popViewControllerAnimated:NO];
NSLog(@"%@", [nc viewControllers]);
[nc popToRootViewControllerAnimated:NO];
NSLog(@"Close");
}
但它不会产生任何视觉差异。
帮助赞赏。
最佳答案
您需要关闭此模态视图 Controller :
- (IBAction)backToMap:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
关于iPhone - 删除新导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8342553/