If you are targeting iOS 5, you can use [self isBeingPresented]
and [self isBeingDismissed]
to determine if a view controller is added or removed from the nav controller.
I also suspect that you can improve the logic when you select / deselect a cell in your table view, so it doesnβt matter if the view controller is suitable or if it fits.
The usual way to do this is as follows: when someone selects a row in the table view in view controller A, he selects / highlights and you press the new view controller B. When view manager B deviates, you animate deselect the table row in viewDidAppear
(so that the user can see its attenuation) in the controller A. You will not worry about whether only the controller of type A appeared or appeared again, because there will be only the selected cell of the table view in the corresponding case.
source share