Reputation: 6691
For example current viewcontroller in Navigation Controller is 'A'. Now before or just after navigating to 'B' from 'A', I want to kill 'A'. Is there a way for such a mechanism ?
Upvotes: 1
Views: 1460
Reputation: 5157
Sure, do something like this:
NSMutableArray *vcArray = [[NSMutableArray alloc] initWithArray: self.navigationController.viewControllers];
[vcArray removeObjectAtIndex: 0];
self.navigationController.viewControllers = vcArray;
// don't forget to release vcArray if you aren't using ARC
Upvotes: 1