reloading uiviewcontroller
Am using UINavigationController for navigation between UIVi开发者_Go百科ewControllers. But got some problem, and am not able to get solution for that.
Here comes the issue - When I navigate back to parent controller, the table in parent controller should get reloaded. I used Interface Builder in the application. Please help in this issue.
Thanks in advance...
When using a UINavigationController, you may use the UINavigationControllerDelegate methods
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
Within both of those methods, you could call the viewWillAppear and viewDidAppear manually.
You could use the viewDidAppear
or viewWillAppear
methods of the first view controller and put your reload code there.
Use the - (void) viewWillAppear
method in order to do this. Here you can put all the method calls that you want to reload when the view is loaded.
精彩评论