Titles are not showing in the navigation bar iphone app

Titles are not showing after the home screen. I have put UITabBarController after the first screen. First screen hasn't got a UITabBarController. I am not sure the way I have implemented the tab.

I have set titles in every view controller by self.title = @"title". Titles are showing in tab items properly.

AppDelegate.m:

 UIViewController *loginView= [[[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil] autorelease];

UINavigationController *loginViewNavController = [[UINavigationController alloc] initWithRootViewController:loginView ];

self.navigationController = loginViewNavController;

self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];

LoginViewController.m:

-(IBAction)navigateMainMenu:(id)sender{

tabBarController = [[UITabBarController alloc] init];

MyAccountsViewController *vc1 = [[MyAccountsViewController alloc] initWithNibName:@"MyAccountsViewController" bundle:nil];
DepositsViewController *vc2 = [[DepositsViewController alloc] initWithNibName:@"DepositsViewController" bundle:nil];
MoreViewController *vc3 = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:nil];
PayTransViewController *vc4 = [[PayTransViewController alloc]init];

NSArray* controllers = [NSArray arrayWithObjects:vc1,vc4, vc2, vc3, nil];
tabBarController.viewControllers = controllers;

[self.navigationController pushViewController:tabBarController animated:YES];

[mainMenuViewController release];

Answers


If you set self.title = @"Title". This title will set in navController title. But In your TabBarController, every items are ViewController. Not an navigationController.

Issue: What you release in this line [mainMenuViewController release];


mostly display title with bellow trickes :-

1. Self.title=@"Your Titile";

2. self.navigationItem.title=@"your Title";

3. when you using UItabBarController you can set Particular Viewcontroller as par your code Title like:- 

  vc1.title=@"your Title";
  vc2.title=@"your Title";
  vc3.title=@"your Title";
  vc4.title=@"your Title";

Need Your Help

Upload File with FileUpload and Stock in database using Framwork entity

asp.net entity-framework file-upload webforms

I want to upload file with file upload and stock in DataBase SQLserver using framework entity , I use this code :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.