Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stadidas

macrumors regular
Original poster
Feb 27, 2006
243
0
Kent, United Kingdom
Hi guys,

I am trying to achieve something very similar to part of the user interface of the Calendar application on the iPhone. When the calendar is being viewed, there is a + icon on the right bar button on the navigation bar. Pressing this raises a modal dialogue, which has it's own navigation controller, so when a calendar detail is edited, the editing view can slide into view.

Currently, I am raising a modal dialogue like this:

Code:
[[self navigationController] presentModalViewController:newTransactionViewController animated:YES];

This works perfectly well. However, it is just a plain view controller being loaded in. What I would like to do is load in a view controller that is the child of a UINavigationController, so that I may then push and pop views while in the modal dialogue state. I have created a xib containing a UINavigationController with it's root controller set to one of my UIViewController subclasses, but I do not know how to use this xib with a modal dialogue.

As always any help will be much appreciated :) .
 

stadidas

macrumors regular
Original poster
Feb 27, 2006
243
0
Kent, United Kingdom
Never mind, I solved this myself. Once I remembered that UINavigationController was a subclass of UIViewController (it had been a long night) I simply did this:

Code:
UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:newTransactionViewController];
[[self navigationController] presentModalViewController:controller animated:YES];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.