0
votes

Since I am a newbie in iPhone development, I need some advice.
My app has two tabs which

  • first tab to show tables of items that has lat/long and url. When I select an item in the tables, then show its location with callout in mapview. in mapview, selecting a callout can show its website in webview.
  • second tab to show all items located on mapview at one time. in mapview, selecting one callout and show its website in webview.

My storyboard layout is,

NavigationController -> tabBarContoller
                        firstTab) tableView ->(segue"showDetail")->(*1 leads to mapView of secondTab) 
                        secondTab) mapView ->(segue"showWeb")-> webView


mapView and webView of each tab shares same class. On storyboard, the segue from tableViewController of first tab leads to mapViewController of second tab.

First tab can show an annotation on mapView, and then show website on webView. Second tab shows annotations on mapView but when I push callout of one annotation, exception throwed that says

'Could not find a navigation controller for segue 'showWeb'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.'

Of course I know I can do with two different implementation of mapview and webview for each tab, but I want to collectively implemented to consider the maintenance.

I think the NavigationController does not function on second tab in this storyboard layout.

Please someone tell me how to do that. Thanks :)

1

1 Answers

0
votes

Your tab bar controller should be the first controller, and the table view and map view controllers should each be embedded in their own navigation controller.