UIViewController から UITabBar をプログラムで作成しようとしています。現在、このアルゴリズムを使用しています。しかし、私は問題に遭遇しました。私に欠けているものを誰か教えてもらえますか?
-(void)loadView{
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor whiteColor];
self.view = contentView;
TabControllerHelper *tabControllerHelper = [[TabControllerHelper alloc]initWithNibName:@"TabControllerHelper" bundle:[NSBundle mainBundle]];
tabControllerHelper.title = @"First";
TabControllerHelper *tabControllerHelper1 = [[TabControllerHelper alloc]initWithNibName:@"TabControllerHelper" bundle:nil];
tabControllerHelper1.title = @"Second";
//dvdInfoController.tabBarItem.image = [UIImage imageNamed:@"dvdicon.png"];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.view.frame = CGRectMake(0, 0, 320, 460);
// Set each tab to show an appropriate view controller
[tabBarController setViewControllers:[NSArray arrayWithObjects:tabControllerHelper, tabControllerHelper1, nil]];
[self.view addSubview:tabBarController.view];
}
私が受け取ったエラー:
2012-12-11 01:34:27.581 SampleUITabView[7134:c07] -[__NSCFType _tabBarItemClicked:]: unrecognized selector sent to instance 0x7574230
2012-12-11 01:34:27.582 SampleUITabView[7134:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType _tabBarItemClicked:]: unrecognized selector sent to instance 0x7574230'
*** First throw call stack: