开发者

UITabbarcontroller switching problem

I have created a tab bar application. In that application, I have three tab bar items. Each tab bar controller has 开发者_开发问答a navigation controller. I have pushed two UIViewController from first tab bar item (using navigationcontroller) that named new UIViewController. Now I want to move from new UIViewController to the third tabbar item.

I'm using the code below:

self.tabbarcontroller.selectedindex = 2;
[self.navigationcontroller poptoviewcontroller:YES];

But it crashes often. What could be the reason?


Why do you pop the view controller?

Just make the change in the tabbar controller and use this code to switch between tabs:

self.tabbarcontroller.selectedindex = 2;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜