building ModalViewAction programmtically
<p>on pressing infobutton modalviewaction comes next to show uiviewcontroller which has uitext view and uinvigation controller on top of uitextview with done button to navigate back to mainviewcontroller. </p>

<p>Everything is handled programmtically without interfacebuilder.</p>

<p>can someone please show me that what will be the code to present uiviewcontroller modally. i am struggling with this issue for last so many days but it shows only uitextview but not navigationcontroller with done button to goback.</p>

<pre><code>self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];

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

 _viewController = [[ModalViewController alloc] init];

[self presentModalViewController:self.viewController animated:YES];
</code></pre>

<p>With above lines of code it shows only UITextview</p>

<p>when i add below lines of code to the above code like this</p>

<pre><code>self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];

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

 _viewController = [[ModalViewController alloc] init];

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:_viewController];

 navigationController.navigationBar.tintColor = [UIColor brownColor];

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

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

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

<p>application crashes and receives message program received signal SIGABRT</p>

<p>thanks</p>
