reloading uiviewcontroller

Am using UINavigationController for navigation between UIViewControllers. 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...

Upvotes: 0

Views: 1105

Answers (3)

lorenzoid
lorenzoid

Reputation: 1832

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.

Upvotes: 0

Till
Till

Reputation: 27597

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.

Upvotes: 1

Rengers
Rengers

Reputation: 15238

You could use the viewDidAppear or viewWillAppear methods of the first view controller and put your reload code there.

Upvotes: 1

Related Questions