I am currently added a new view when a mapkit annotation is clicked:
-(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];
}
What I would like to do is on the new view is have a back button that will remove the view and display the mapkit again.
I am using a tabbar in the normal app. I have setup a button on the new view and tried this:
- (IBAction)backToMap:(id)sender {
UINavigationController *nc = [self navigationController];
NSLog(@"%@", [nc viewControllers]);
[nc popViewControllerAnimated:NO];
NSLog(@"%@", [nc viewControllers]);
[nc popToRootViewControllerAnimated:NO];
NSLog(@"Close");
}
But it doesn’t make any visual difference.
Help Appreciated.
You need to dismiss this modal viewController: