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 7446047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:12:13+00:00 2026-05-29T12:12:13+00:00

I have posted similar question previously, but this time I am providing some code

  • 0

I have posted similar question previously, but this time I am providing some code for analysis. I am creating PopOverController in my AppDelegate.m file and I am adding a NavigationController variable which I want to pass to PopOverController.m file so that using that I want to push other views. Here is how I am creating the PopOver in AppDelegate.m

- (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 *popoverContentController = [[PopOverViewController alloc]init];

        UINavigationController *navcon = [[UINavigationController alloc]initWithRootViewController:popoverContentController];

        popoverContentController.contentSizeForViewInPopover = CGSizeMake(250, 85);
        popover = [[UIPopoverController alloc]initWithContentViewController:popoverContentController];            

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

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

    }
}

And in my PopOverController.m I am trying to use the NavigationController to choose views like this:

- (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.navigationController pushViewController:sendEmailViewController animated:YES];
   else
       [self.navigationController pushViewController:downloadFilelViewController animated:YES];
}

But when I click on my TabBar item for the PopOver I am getting this SIGABRT message :

Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘The content view controller argument must be the root of its associated view controller hierarchy.’

Any reason why this is appearing? Is there somewhere I am making a mistake in my code ?

  • 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-29T12:12:15+00:00Added an answer on May 29, 2026 at 12:12 pm
    UINavigationController *navcon = [[UINavigationController alloc] initWithRootViewController:popoverContentController];
    

    you are trying to put a popover controller in a navigation controller. I don’t think you want this.

    To put navigation in popover, you should do this,

    UINavigationController *navcon = [[UINavigationController alloc] initWithRootViewController:myViewController];
    popoverContentController = [UIPopoverController initWithContentViewController:navcon]
    

    and init the navigation controller with the viewController you want, like TableViewController or something else.

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

Sidebar

Related Questions

I have posted a question on here previously asking similar advise, but this project
I posted another question similar. This is my old code as some ppl say
I have already posted a question about this, but the situation has changed sufficiently
I posted a similar question previously, but none of the answers worked and I've
I know i have posted a similar question before but i am not able
I have posted a similar question before why my local object destroyed twice? but
I posted a similar RBL question but I have a new issue arising so
I've posted similar question but no response. I have a jQuery Mobile site and
I posted a similar question earlier, but I now realize I should have been
I posted a similar question yesterday with the same code, I have rewritten and

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.