modalviewcontroller navigating back to mainviewcontroller
<p>In my application mainviewcontroller is pushing modalviewcontroller by using this</p>

<pre><code>[navigationController pushViewController:_viewController animated:YES];
</code></pre>

<p>For going back to mainviewcontroller using popviewController  </p>

<pre><code>[self.navigationController popViewControllerAnimated:YES];
</code></pre>

<p>Now as per apple reference documentation <strong>delegate is used by the presented view controllers to notify the presenting view controller when it is ready to be dismissed</strong>.</p>

<p>But in my case i am not using presentviewController and dismissmodalviewcontroller. It means my done button cannot use delegate to navigate back to mainviewcontroller like this</p>

<pre><code> [delegate dismissModalView:self];
</code></pre>

<p>So what code i should write in donebutton method so that it uses </p>

<pre><code>-(void) dismissModalView:(UIViewController *)viewController;
{

   [self.navigationController popViewControllerAnimated:YES];

 }
</code></pre>

<p>to navigate back to mainviewcontroller.</p>

<p>help will be appreciated.</p>

<p>Thanks</p>
