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

  • Home
  • SEARCH
  • 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 7417505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:42:53+00:00 2026-05-29T07:42:53+00:00

I am working on a small app, according to the requirement the app should

  • 0

I am working on a small app, according to the requirement the app should have a tabBarItem with 3 items. For this I have programmatically created the tabBarController in the AppDelegate.m file and added the 3 different viewControllers, instantiated them and everything is working good. I see the tabBarItems and all views are working. In one of the views lets say in SecondViewController I show a popOverController where I used a UITableView and populate it with items. When I click one of the items it should show another view lets say sendFeedback. Until there everything is working fine, but as soon as this sendFeedback is presented as the modal view, it occupies the whole app i.e it hides the tabBarItem.

I present the important pieces of code here for review:

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.

    UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
    viewController1.title = @"First";              

    UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
    viewController2.title = @"Second";

    UITableViewController *tableView3 = [[tableViewController alloc]initWithNibName:@"tableViewController" bundle:nil];
    tableView3.title = @"Third";

    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, tableView3 ,nil];
    self.tabBarController.delegate = self;
    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];

    [viewController1 release];
    [viewController2 release];
    [tableView3 release];

    return YES;
}

In my popOverViewController.m file I am checking which row is selected in the table according to that I present the view

#pragma mark - TableView Delegate Methods

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{        

    sendFeedback *sendEmailViewController = [[sendFeedback alloc]initWithNibName:@"sendFeedback" bundle:nil];

    downLoad *downloadFilelViewController = [[downLoad alloc]initWithNibName:@"downLoad" bundle:nil];

    if (indexPath.row == 0)
        [self presentModalViewController:sendEmailViewController animated:YES];
   else
        [self presentModalViewController:downloadFilelViewController animated:YES];

}

Can anyone guide me how to overcome this with the multiple views. In case if anyone requires more information from my side I would be glad to provide.

NOTE: It is the same with the other view (downLoad) as well

EDIT: Here is how I am initializing my PopOverController in the AppDelegate.m file

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController

{
    if([viewController isKindOfClass:[SecondViewController class]]){

        NSInteger index = [[self tabBarController] selectedIndex];

        CGRect buttonFrame = [[[[[self tabBarController] tabBar] subviews] objectAtIndex:index+1] frame];

        PopOverViewController *popoverView = [PopOverViewController new];       

        popoverView.contentSizeForViewInPopover = CGSizeMake(250, 85);

        popover = [[UIPopoverController alloc]initWithContentViewController:popoverView];

        NSLog(@"X:%f Y:%f",buttonFrame.origin.x,buttonFrame.origin.y);        

        [popover presentPopoverFromRect:buttonFrame inView:self.tabBarController.tabBar permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];        
    }

Thanks

  • 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-05-29T07:42:54+00:00Added an answer on May 29, 2026 at 7:42 am

    Modal view controllers are used to “block” your application and fulfill a task before you can proceed. So modal view controllers are not what you want to use.

    Instead wrap your controllers which have to be shown in the popover in a navigation controller. In the tableView:didSelectRowAtIndexPath: method you can push the corresponding view controller to the navigation stack.

    To slove your problem:
    At the place where you create the popovercontroller initialize it with a new UINavigationController. And the navigation controller you have to initialize with a rootviewcontroller namely PopOverViewController.m.

    PopOverController *popoverContentController = [[PopOverController alloc] init];
    UINavigationController *navcon = [[UINavigationController alloc] initWithRootViewController:popoverContentController];
    popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContentController];
    

    And in PopOverController.m

    if (indexPath.row == 0)
        [self.navigationController pushViewController:sendEmailViewController animated:YES];
    else
         [self.navigationController pushViewController:downloadFilelViewController animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small app I'm working on where I'm trying to use Django's
I have been working on a small php app (400K total). But in the
So, I'm working on a small web app and I have it to a
I am working on a small Android App! I have a class MyPref public
I am working on a small rails app and have a problem with ruby's
I'm working on a small app that uses and xml file to print an
I have been working on a small web app using the Stripes framework. Now
I am working on a small app where I need to remove the starting
I am working on a small app and am using jQuery Tools Tooltip (
I am currently working on a small app engine project with python, jquery. I

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.