开发者

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.

**ipho开发者_开发百科neDelegate.tabbarcontrolObject setSelectedIndex:1**


Have you set the delegate to yourself in the controller where you implement the delegates?

[iphoneDelegate.tabbarcontrolObject setDelegate:self] ?


i have added this line and got my solution

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜