NavigationController not showing on UIViewController presenting modally
<p>Have a mainviewcontroller and on it have UIToolbar which has a UIBarButtonItem Info which shows UIViewcontroller modally.</p>

<p>Now when pressing Infobutton it is showing UIViewController modally which has UITextView but not showing UINavigationController with Done button.</p>

<p>I am not able to figure it out what i am missing in my code.</p>

<p>This is how i am showing UITextView and NavigationController in UIViewController modally.</p>

<pre><code>#import "ModalViewController.h"
#import &lt;QuartzCore/QuartzCore.h&gt;

@implementation ModalViewController

@synthesize textView;
@synthesize navBar;
@synthesize navigationController;
@synthesize delegate;

-(void)dealloc
{
  [textView release];
[navBar release];
[navigationController release];
[super dealloc];
 }

- (void) viewDidLoad
{
    [super viewDidLoad];

self.title = @"Info";

UINavigationController *navigationController = [[UINavigationController alloc]init];
                                                 //initWithRootViewController:viewController];

self.navigationController.navigationBar.tintColor = [UIColor brownColor];

self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(Done:)] autorelease];

self.textView = [[[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 416)]autorelease];

self.textView.textColor = [UIColor whiteColor];

self.textView.font = [UIFont fontWithName:@"Georgia-BoldItalic" size:14];

//self.textView.delegate = self;

self.textView.backgroundColor = [UIColor brownColor];

self.textView.layer.borderWidth = 1;

self.textView.layer.borderColor = [[UIColor whiteColor] CGColor];

self.textView.layer.cornerRadius = 1;

self.textView.textAlignment =  UITextAlignmentCenter;

self.textView.text = @"This is UITextView presenting modally.\nThis is UITextView presenting modally.\nThis is UITextView presenting modally.\nThis is UITextView presenting modally.\nThis is UITextView presenting modally.\nThis is UITextView presenting modally.

self.textView.editable = NO;

 //[self.view addSubview:navigationController.view];

[self.view addSubview: self.textView]; 

//[navigationController release];
</code></pre>

<p>}</p>

<p>And this is how UIViewController presented modally</p>

<pre><code>//Create a final modal view controller

    UIButton *modalViewButton = [UIButton buttonWithType:UIButtonTypeInfoLight];

    [modalViewButton addTarget:self action:@selector(modalViewAction:) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem *modalBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:modalViewButton]; 

   self.navigationItem.rightBarButtonItem = modalBarButtonItem;

- (void) modalViewAction:(id)sender

{
    self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];  

 //self.viewController = [[ModalViewController alloc] init];

 [self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];


 //ModalViewController *myModalViewController = [[ModalViewController alloc] init];

  //UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:myModalViewController];

    //navigationController.navigationBar.tintColor = [UIColor brownColor];

    _viewController = [[ModalViewController alloc] init];

   //[navigationController pushViewController:_viewController animated:YES];

  [self presentModalViewController:self.viewController animated:YES];

   //[self.view addSubview:navigationController.view];

    //[navigationController release];



    [myModalViewController release];

}
</code></pre>

<p>I will appreciate if you can figure out what i m doing wrong or missing in my code.</p>

<p>Thanks a lot.</p>
