views:

144

answers:

1

Hey everyone,

I'm relatively new to iPhone programming but have read my way through a hefty book already.

I want to build a Tabbed Application where in one of the tabs I can push a button that presents a modal view over the screen.

I have built demo apps that utilize UITabBarController and the ModalView system, but I can't figure out how to combine them.

Help is greatly appreciated. I'm really stuck because it's this set up of the views that's the only thing I don't know how to do with my app. If you could give me a rundown (sample code) of how the setup should look, that would be fantastic.

thank you!

A: 

You can show a display a modal view controller from one of the tabs of your tab bar controller using the following code.

UIViewController* vc = [[[UIViewController alloc] init] autorelease];
[self presentModalViewController:vc animated:YES]

That will cause the View Controller to be displayed modally over the tab bar.

DHamrick
If I'm not mistaken, that goes in IBAction that summons the modal.Because I'm working with a window-based app that is so far just written to flip through the tabs, I'm not quite sure how the modal/delegate would be set up in the code. When I've done it before (in a singleview app), I used the AppDelegate, but that didn't work with the tabbed app.
Collin Mason