Crashing app when i want to go rootview from other view controller
<p>I want to go Root view Controller from another view controller but i got the terminating error. following is the error message in console, </p>

<pre><code>Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray removeObjectsInRange:]: index (4) beyond bounds (1)'
</code></pre>

<p>This is my code for that</p>

<pre><code>NSArray *arr=self.navigationController.viewControllers;
 [self.navigationController popToViewController:[arr objectAtIndex:2] animated:YES];
</code></pre>

<p>So any one can give me the suggestion on it so can remove the crash</p>
