Search code examples
iostabbarviewwillappear

Refreshing a tabbar in iOS app


In my app I have a tab bar. When I move from one tab to the other the delegate method is not been called.

I am just switching from one tab to the other by a button at that time the ViewWillAppear is not calling. Because of this in the next tab when I hit a button, it is hitting an API and the returned value is not shown to me in my screen. How to overcome this problem?

Following is the line which I have given when a tab button is clicked.

**iphoneDelegate.tabbarcontrolObject setSelectedIndex:1**

Solution

  • i have added this line and got my solution

    [self.tabBarController setSelectedIndex:1];
        [self.tabBarController.selectedViewController viewWillAppear:YES];