1

hey guys i have a tab bar based app and it has a view controller on a tab which receives data from user i want to save that data by nsuserdefaults and show that saved data in another tab's first view controller. But the problem is after saving in the first whenever the mentioned tab is clicked the saved data is not refreshed there in that view.how to reload that view.

i know because it is a tabbar so neither viewDidLoad nor viewWillAppear is called on click of that tab.

i want that view to reload each time whenever tab is clicked/tapped

Please help me.

1 Answer 1

1

i had the same problem but i'm trying to solve by taking tabbar delegate and using one of its method:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

hope this works

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

3 Comments

yaah but i've a different situation i'm also using a button where i'm loading the same view so.... ok fine i got it
No actually i was loading the same tab item's view on a button's click i'm not sure if this method is called also on that button's click. thanks for your help
yeah i was true and found the right solution call this method of tabbarcontrollerdelegate - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController

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.