Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:41:17+00:00 2026-06-11T14:41:17+00:00

This is what i am doing in my application: in my appDelegate.m file ,

  • 0

This is what i am doing in my application:

in my appDelegate.m file ,

//Four Views
@synthesize fvc;
@synthesize svc;
@synthesize tvc;
@synthesize pvc;

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
 {
 NSString *name1,*name2,*name3;
 name1 = NSLocalizedString(@"home", nil);
 name2 = NSLocalizedString(@"quote", nil);
name3 = NSLocalizedString(@"ship", nil);
UITabBarController *tabBar = [[UITabBarController alloc] init];

 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; 

 //[application setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
tvc = [storyboard instantiateViewControllerWithIdentifier:@"thirdview"];
fvc = [storyboard instantiateViewControllerWithIdentifier:@"firstview"];
svc = [storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"];

 pvc =[storyboard instantiateViewControllerWithIdentifier:@"PayViewController"];

fvc.tabBarItem.title = name1;
 fvc.tabBarItem.image = [UIImage imageNamed:@"home.png"];
 fvc.tabBarItem.titlePositionAdjustment = UIOffsetMake(2.0, 0);

 tvc.tabBarItem.title = name2;
 tvc.tabBarItem.image = [UIImage imageNamed:@"ping.png"];
 tvc.tabBarItem.titlePositionAdjustment = UIOffsetMake(0, 2.0);

 svc.tabBarItem.title = name3;
 svc.tabBarItem.image = [UIImage imageNamed:@"zoom.png"];    
 svc.tabBarItem.titlePositionAdjustment = UIOffsetMake(-5.0, 0);

 NSLog(@"appdelegate %@ and %@",svc,svc.title);

 tabBar.viewControllers = [NSArray arrayWithObjects:fvc,svc,tvc,nil];

 // the below line does not allow [self.navigationController pushViewController:svNew  animated:YES]; to function

 self.window.rootViewController = tabBar;
 // Override point for customization after application launch.
 return YES;

In my fvc view im performing change view operation in okPressed method:

 - (IBAction)okPressed:(id)sender {
 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; 

 SecondViewController *svNew = [storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"];

 [self.navigationController pushViewController:svNew animated:YES];
 }

When i comment the code in the appdelegate method the switching between the views thru the okPressed method is executed successfully. But when I uncomment the appDelegate method it does not perform switching. What i found out was , the code in appdelegate method “self.window.rootViewController = tabBar;” is the culprit. Can anyone guide me on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:41:18+00:00Added an answer on June 11, 2026 at 2:41 pm

    I think you should embed your UITabBarController in a Navigation Controller to make it work:

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:tabBar];
    

    and then

    self.window.rootViewController = navController;
    

    Otherwise you can’t push anything since you probably got no UINavigationController to push things to!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My AppDelegate class is registered for a particular notification like below - (BOOL)application:(UIApplication *)application
i have this at my appdelegate: for 1st app: - (void)applicationDidFinishLaunching:(UIApplication *)application { [window
Iam doing one application in iphone.In this i need to get the browsing history
I don't know what's the best way to doing this. On my application.html.erb I
We need to represent huge numbers in our application. We're doing this using integer
...before everything, I'm doing this out of curiosity only. Nothing real-world application here, but
how to delete/remove call log from application. I am doing like this this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null); it
I'm doing an asp.net application with one page. In this page, I have one
I have a WCF service application and in this app I am doing calls
In my AppDelegate.m, in the application: didFinishLaunchingWithOptions: method, I put the following line: NSManagedObjectContext

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.