I have added a few buttons to self.view. When the user clicks on one button, i will load another view (subView). My code where i am loading the subView is shown below
Try removing the subview like this:
for (UIView *subView in self.view.subviews) { if (subView.tag == (int)yourSubViewTag) { [subView removeFromSuperview]; } }