0

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...

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

7 Comments

What do you mean with "not worked"? Was the method not called? How do you reload the table view? Need some more information here.
those methods are not getting called.
Implement the two methods described by Rengers and insert an NSLog into those methods. Check the console after navigating back an forth. Does the console show your logging?
i implemented those two methods with NSLog in that but the problem here is those methods are not getting called.
Well, they may not be automatically called, depending on your view structure. Make sure the navigation controller is directly added to the window.
|
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.