【发布时间】:2015-12-22 10:34:44
【问题描述】:
我有一个故事板场景,它是一个 UITabBarController 场景,它有大约 5 个标签栏项目。我要做的是根据用户的捆绑设置删除一两个项目。所以我创建了一个UITabBarController.h 和.m 文件,如下所示:
.h:
#import <UIKit/UIKit.h>
@interface LHTabBarController : UITabBarController
@end
.h:
#import <Foundation/Foundation.h>
#import "LHTabBarController.h"
@implementation LHTabBarController
-(void)viewDidLoad
{
/*NSMutableArray *tabbarViewControllers = [NSMutableArray arrayWithArray: [self.tabBarController viewControllers]];
[tabbarViewControllers removeObjectAtIndex:1];
[self.tabBarController setViewControllers: tabbarViewControllers];*/
[super viewDidLoad];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[super viewDidAppear:animated];
}
-(void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end
我将这个类连接到我故事板中的UITabBarController。
我尝试了注释掉的代码,但这给了我一个数组,说数组是空的。
如何从此类中删除标签栏项目?
【问题讨论】:
标签: ios objective-c uitabbarcontroller uistoryboard