If _viewA
is in a view hierarchy, it is retained by its superview, so doing _viewA = nil
will not release it, and it will still be there when the viewWillAppear
method gets fired.
Then, in your viewWillAppear
you are adding a "duplicate" of your viewA
, with its own collectionView inside, placed just over the original one: you see one view, but in truth they are two views overlapped.
So, you should just add a removeFromSuperview
call in your didReceiveMemoryWarning
method to get rid of this
The same happens for viewB
.