I have 2 views and 1 viewController :
In the first view I have added another view:
[self.view addSubView:self.secondView];
In Second View when i Press Back then i have remove the second view for back to the first View
[self.view removeFromSuperView];
but in my first view there is the UITableView I have to use [UITableView reloadData]; method of UITableView but I don’t know which method is called when secondView is removed.
My main objective is to call some method when I remove the second view and call any method which will reload the data.
I have tried many times but to call the method and delegates of the view but nothing happen, viewDidLoad or viewWillAppear or viewDidAppear no method is catch for the second time.. please tell me…
Thanking in advance.
If you want the
viewWill...methods to run, you should use one of the view controller or modal view display methods rather than manually adding the subview. For example, using aUINavigationControlleris probably the best approach for what you’re describing. Alternately, you can use thepresentModalViewController:animated:method to present a modal view.See the View Controller Programming Guide for more information on handling transitions between views.