Coocoo4Cocoa
Coocoo4Cocoa

Reputation: 50826

UINavigationController on top of a modal view

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 modal views 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 modal view controller.

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

Upvotes: 0

Views: 1419

Answers (1)

slf
slf

Reputation: 22767

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.

Upvotes: 4

Related Questions