开发者

Refresh a tab in xcode?

开发者 https://www.devze.com 2023-03-05 00:31 出处:网络
Is there a way to refresh a tab\'s content in XCode?I\'m s开发者_如何学运维etting a tab as follows:[[dappDelegate tabBarController] setSelectedIndex:1];

Is there a way to refresh a tab's content in XCode? I'm s开发者_如何学运维etting a tab as follows: [[dappDelegate tabBarController] setSelectedIndex:1];

However, when I try and do it from a different screen, the same tab screen is still selected. Is there a way to have the tab completely reload the data?

Thanks, Graeme.


I use a hack around that seems to work for my case:

if(tabBarController.selectedIndex == 1)
{
[tabBarController setSelectedIndex:-1];
[tabBarController setSelectedIndex:1];
}
else
{
[tabBarController setSelectedIndex:1];
}
0

精彩评论

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

关注公众号