Apple says:
removeFromSuperview Unlinks the receiver from its superview and its window, and removes it from the responder chain.
- (void)removeFromSuperview
Never invoke this method while displaying.
So before I call that, I should call setHidden:YES? Would that be enough?
That warning is there so that you don't call
removeFromSuperview
from within adrawRect:
method. The Cocoa runtime makes extensive use of the view hierarchy during drawing operations, so removing a view from its superview while drawing can really screw things up.Calling
removeFromSuperview
at any other time is perfectly fine, and there is no need to hide the view prior to removing it.