brush51
brush51

Reputation: 5771

how to dismissModalViewController by clicking tabBarItem

When i didSelectRowAtIndexPath in my tableView, my DetailView is loaded. In detailView i can return to the tableView with a backButton, which dismisses the detailview.

In My app i have in front a tabBar (tabbarcontroller), everytime. When the detailView is loaded and in case of the backbutton is clicked a tabBarItem, the detailViewController is not dismissed.
That means, that i cant load the detailView again, if i didSelectRowAtIndexPath.

Can someone help my out with this problem?

Thanks,
brush51

Upvotes: 1

Views: 165

Answers (1)

Fernando Valente
Fernando Valente

Reputation: 1096

The UITabBarDelegate protocol has a method called tabBar:didSelectItem:. You may use this method to detect when an UITabBarItem was selected and then call a method to dismiss the detailViewController.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarDelegate_Protocol/Reference/Reference.html

Upvotes: 2

Related Questions