Crashing app when i want to go rootview from other view controller
- by Priyanka
Hello All,
I want to go Root view Controller from another view controller but i got the terminating error. following is the error message in console,
Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray removeObjectsInRange:]: index (4) beyond bounds (1)'
This is my code for that
NSArray *arr=self.navigationController.viewControllers;
//ListOfInjuriesViewController *list=[[ListOfInjuriesViewController alloc]init];
[self.navigationController popToViewController:[arr objectAtIndex:2] animated:YES];
So any one can give me the suggestion on it so can remove the crash