The situation: I have an application entirely based on UInavigationcontroller. At some point in the application I push the controller A wich contains several subviews. Then i push a controller B which is an other new instance of the same class of controller A. Also controller B has some subviews.
When I pop controller B, the view associated to the controller A is shown. The problem is that on the screen there are also all the things of the view associated to controller B (over the subviews of A).
My guess is that somehow the problem is related to the fact that both controllers are instances of the same class. (With controller of different classes it works perfectly)
Thx.
Edit: All the stuff is done programmatically and with xib (no storyboard)
Push of view A:
ScreenViewController *secondView = [[ScreenViewController alloc] initWithNibName:@"ScreenViewController" bundle:nil];
// set some properties
[[self navigationController] pushViewController:secondView animated:YES];
Push of view B:
ScreenViewController *newScreenView = [[ScreenViewController alloc] initWithNibName:@"ScreenViewController" bundle:nil];
// set some properties
[[self navigationController] pushViewController:newScreenView animated:YES];
The view associated to the ScreenViewController
contains a UIView
(as a property) to wich I add all the subview that I need to display. I use a property and not directly the view because I need to put it into a UIScrollView
.