I have 3 view controllers in my UINavigationController. If I use pushViewController and popViewController to switch between view controllers, everything is okay.
But if I invoke setViewControllers in order to re-arrange their order, I get crash when I touch backward navigation bar button.
[UIBarButtonItem performSelector:withObject:withObject]: message to deallocated instance.
Original stack is A and B, and next I've set A and C like bellow.
[delegate.navigationController setViewControllers:[NSArray arrayWithObjects:[[delegate.navigationController viewControllers] objectAtIndex:0], controllerC, nil] animated:YES];
What I've found strange is..., if I invoke that method with animated:NO, crash does not occur.
What is the secret of animated parameter for my code? help me please...:(