views:

44

answers:

2

Hello,

I am looking for the best approach to mimic the iPod application on the iPhone/iPod Touch. Specifically, I want to mimic what happens when the iPod player (when a track is actually played) shows up. The iPod application starts as a tabBarController with every tab holding a navigationController. However, when a track is played, the entire tabBarController is replaced by a new viewController.

What is the best approach for this kind of UI? At first, I thought the tabBarController needed to be added to a separate navigationController, but this resulted in two navigation bars (one on top of the other).

Any advice is welcome. Cheers.

A: 

you want to present the new viewcontroller as a modal vc.

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
fluchtpunkt
The solution I'm looking for is not a modal presentation of my view controller. As in the iPod application, the view controller holding the music player is pushed onto a navigation stack. It appears this is the same navigation stack as the one the tabBarController is on.
bare_nature
+1  A: 

Use the hidesBottomBarWhenPushed property. Your controller will stay within your existing navigation-controller hierarchy (unlike fluchtpunkt's solution), and the tab bar will automatically hide and show itself when your player controller appears and disappears.

Noah Witherspoon
That's the behavior I was looking for. Thanks a lot, Noah. I was not aware of this property of UIViewController. Much simpler than my initial approach ;-).
bare_nature