我创建了一个如下所示的 UITabBarController 并推送了一个 navigationController,但我现在无法设置选项卡栏项目的标题等...因为 tabbarcontroller 为 NULL。
请你告诉我哪里出了问题。
UITabBarController *tabBarController = [[UITabBarController alloc] init];
LoggedInFeedNavigationController *lvc = [[LoggedInFeedNavigationController alloc] initWithAccount:account];
[tabBarController setViewControllers:[NSArray arrayWithObject:lvc]];
[tabBarController setSelectedIndex:0];
[self presentModalViewController:tabBarController animated:YES];
[tabBarController release];
[lvc release];
In the 文档 http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html对于 tabBarController 我看到以下内容
如果不存在标签栏或者
接收者是一个模态视图, 这
财产为零。
在评论中它说您正在从内部调用 self.tabBarControllerLoggedInFeedNavigationController
我认为它应该可以正常工作。但是您正在以模态方式显示选项卡栏,如果文档意味着即使它作为模态视图位于 UITabBarController 内部,那么这就是您的问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)