Dealloc not called changing tab
问题 Let's suppose to have a tab bar controller with two tabs, A and B, where A is a navigation controller. When the user is in A, he can push A1 and then A2, which are both view controllers. A back button on A2, performs: [self.navigationController popViewControllerAnimated:YES]; which correctly triggers the dealloc method on A2. If the user is in A2 and then switches to tab B, I need the dealloc method to be called on A2; therefore I've implemented the following method in the TabBarController: -