views:

15

answers:

1

It seems that the UIView has not methods like "didRemoveFromSuperview" or "willRemoveFromSuperview".Then,How to listen to the event when a UIView removed from its superView?I should use KVO? thanks in advance!

A: 

You can subclass your UIView and post notifications from it's - (void)removeFromSuperview method.

beefon
I find.Api doc says:willMoveToSuperview:Informs the receiver that its superview is about to change to the specified superview (which may be nil).-----------------------------------------When this method is called and the parameter is nil, the view is being removed
Jagie