嗨朋友我刚刚添加TabbarController
并使用波纹管代码UISplitViewController
相关:-DetailsViewController
-(IBAction)loginclick:(id)sender
{
tabBarController =[[UITabBarController alloc]init];
NSMutableArray *array = [NSMutableArray array];
NSMutableArray *tabArray = [NSMutableArray array];
UISplitViewController *HomeSpilitView = [[[UISplitViewController alloc] init]autorelease];
HomeSpilitViewController *HomeMster = [[HomeSpilitViewController alloc] initWithNibName:@"HomeSpilitViewController" bundle:nil];
UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:HomeMster] autorelease];
[array addObject:masterNavigationController];
HomeDetailsViewController *HomeDetailsViewControllers = [[HomeDetailsViewController alloc] initWithNibName:@"HomeDetailsViewController" bundle:nil];
UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:HomeDetailsViewControllers] autorelease];
[array addObject:detailNavigationController];
[HomeSpilitView setViewControllers:array];
[tabArray addObject:HomeSpilitView];
HomeMster.objHomeDetailsViewcontroller = HomeDetailsViewControllers;
HomeSpilitView.delegate = HomeDetailsViewControllers;
array = [NSMutableArray array];
UISplitViewController *splitViewConntroller2 = [[[UISplitViewController alloc] init]autorelease];
REMMasterViewController *viewCont3 = [[REMMasterViewController alloc] initWithNibName:@"REMMasterViewController" bundle:nil];
UINavigationController *masterNavigationController3 = [[[UINavigationController alloc] initWithRootViewController:viewCont3] autorelease];
[array addObject:masterNavigationController3];
REMDetailViewController *viewCont4 = [[REMDetailViewController alloc] initWithNibName:@"REMDetailViewController" bundle:nil];
UINavigationController *detailNavigationController2 = [[[UINavigationController alloc] initWithRootViewController:viewCont4] autorelease];
[array addObject:detailNavigationController2];
viewCont3.detailViewController = viewCont4;
splitViewConntroller2.delegate = viewCont4;
[splitViewConntroller2 setViewControllers:array];
[tabArray addObject:splitViewConntroller2];
// Add the tab bar controller's current view as a subview of the window
[tabBarController setViewControllers:tabArray];
objAppdelegate.window.rootViewController=tabBarController;
}
我在每个ViewController
中设置了导航标题,- (id)initWithNibName
如下所示:-
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"Detail", @"Detail");
// self.navigationItem.title=@"details"; I am trying with this line code also
// self.tabBarItem.title=@"details";
}
return self;
}
在上面我也设置了标题self.navigationItem.title=@"details
, self.tabBarItem.title=@"details
但我仍然有同样的问题我不知道错误在哪里,请指导我并帮助。
谢谢