views:

992

answers:

1

I have a modal view controller that I put onto screen using presentModalViewController:animated. This particular view controller, an instance of UIViewController, has a UITableView and cells with further detailAccessory options. Clicking on a date row should allow a controller with UIDatePicker to populate on the screen. The problem is this:

1) You cannot put two modalView's onto screen at once. 2) Because of constraint #1, I have to use UINavigationController and pushViewController:animated:. What this does is push my controller with a UIDatePicker on top of the stack, but physically BELOW my modalViewController.

Does this imply that my modalViewcontroller needs its own UINavigationController? What's the best bet to go about this?

+4  A: 

If I'm reading this correctly you are

  1. presenting a modal view
  2. responding to the cell did select message
  3. pushing in a new view somewhere, probably with the navigation controller underneath your modal view

If you want to present a new UINavigationController modally, you can. A good example of that is the People Picker.

I think it may be easier to just slide in a a UIDatePicker from the bottom on your modal view when the user performs the action. That would eliminate the need to push in a new view controller, but you would need to resize the table view to accommodate the showing/hiding of the date picker.

slf
Is People Picker a demo which Apple has written, hosted on their developer site?
Coocoo4Cocoa
The people picker is a built in picker like the Image Picker. It's in the AddressBookUI framework
slf