我尝试以编程方式创建UITabBarController,但是当我点击tabBarItem时我有一个SIGABRT。
来源:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
tabBarController = [[UITabBarController alloc] init];
UIViewController *vc1 = [[UIViewController alloc] init];
UIViewController *vc2 = [[UIViewController alloc] init];
UIView *v1 = [[UIView alloc] init];
UIView *v2 = [[UIView alloc] init];
vc1.title = @"vc1";
vc2.title = @"vc2";
tabBarController.viewControllers = [[NSArray alloc] initWithObjects:vc1, vc2, nil];
self.view = tabBarController.view;
}