views:

37

answers:

0

My app has a UITabBarController as its main view. The tab bar has three tab items, one of which contains a UIViewController with a MKMapView on it.

The MKMapView has annotations which have disclosure buttons on them.

UITabBarController
  UIViewController (one of the tabs)
    MKMapView
      MKAnnotation
        DisclosureButton

When the user selects a disclosure button, I want to display a details view for the map annotation, like the iPhone's built-in Map app does.

I would like for the details view to slide in from the right and have a "back" button entitled "Map" that takes the user back to the map view.

I've created a view controller for the detail view, but I'm having trouble getting it to present properly.

I've tried pushing the view controller onto the MKMapView view controller's UINavigationController stack, but the view does not appear.

I can display the view with presentModalViewController, but then the view slides in from the bottom and doesn't have the correct "Back" button to take the user back to the map.

What is the proper way to present the details view from within the context of the tab bar controller?