am adding one view to another view and when I remove new view then which method of first view will called ?
here i try viewWillAppear but it doesn't call.
Can anyone tell me about this?
I add view like,
[self.view addSubview:newview.view];
and I remove remove this view by ,
[self.view removeFromSuperview];
can Somebody tell me which method will be call when removeFromSu开发者_StackOverflow社区perview.
Give viewDidAppear
a shot. viewWillAppear
is sketchy at best for certain scenarios.
If you are adding and removing a subview, viewWillAppear will not get called on the superView or other views in the superview. You need to use a navigation controller, modal view controller, or tab view controller in order for this to work as you expect. It seems like you should use a UINavigationController and use push/pop instead of add/remove.
精彩评论