【发布时间】:2012-10-07 10:26:51
【问题描述】:
我正在尝试在 UITabBar.viewControllers 数组中选择我的 UINavigationControllers 之一。
我之前尝试过设置 UITabbarController.selectedIndex,但 Apple 文档说: “要选择更多导航控制器本身,您必须更改 selectedViewController 属性的值。”
AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
UINavigationController *navController = [appDelegate.objTabBarController.viewControllers objectAtIndex:5];
[appDelegate.objTabBarController setSelectedViewController:navController];
这样做很好,但是当我改回MoreViewController的列表视图时,左侧的图标消失了,不会再回来了。
一切正常,当用手指选择它时。
以编程方式选择时出现错误 -> 图像消失了
任何建议我做错了什么?
最好的问候, 史蒂夫
【问题讨论】:
-
不应该是
objectAtIndex:4吗? -
哪张图片不见了?我很难理解你的问题。
标签: iphone ios image uinavigationcontroller uitabbar