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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:34:30+00:00 2026-06-13T09:34:30+00:00

I have a viewController that I want him to pop when I moving to

  • 0

I have a viewController that I want him to pop when I moving to another tab in the application. My problem is that when I’m inside this view I have a “plus” button for adding people with ABPeoplePickerNavigationController, than when the people picker becomes active, the view is popping as well, so when I finished of choosing people the application crushes, because it don’t have any view to come back to.

this is the viewWillDisappear:

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController popViewControllerAnimated:YES];
}

How can I solve it?

New code:

- (void)viewWillDisappear:(BOOL)animated
{
    NSArray *controllers =  self.darioTabController.childViewControllers;
    UIView *v;

    for (UIViewController *vc in controllers)
    {
        if ([vc isKindOfClass:[@"ModalPresnterViewController" class]]) // or even [ABPeoplePickerNavigationController class]
        {
            v = vc.view;
        }
        else
            [self.navigationController popViewControllerAnimated: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-06-13T09:34:32+00:00Added an answer on June 13, 2026 at 9:34 am

    If you want the action happen only when you tap the tab bar you can use the TabBarController delegate method :

    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
    {
      //The user click on the item corresponding to ABPeoplePickerNavigationController
      if([viewController isKindOfClass:[ABPeoplePickerNavigationController class]])
      {
        //Do something if you cant
      }
      else // The user click on an other view controller (pop the ABPeoplePickerNavCtrl)
      {
        [yourController.navigationController popViewControllerAnimated:YES];
      }
    }
    

    Alternatively you can check which TabBarItem is selected :

    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
    {
      //Check if the selected view controller (ABPeopleNavCtrl)
      if(tabBarController.selectedIndex == indexOfTheABPeoplePickNavigationController)
      {
    
      }
      else // Else the user tap on an other item, so pop the controller you want
      {
        [theViewControllerToPop.navigationController popViewControllerAnimated:YES];
      }
    }
    

    NB : Remeber to set the UITabBarController delegate 😉

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

Sidebar

Related Questions

I want to have a ViewController that has a table view on the top
I'm developing an iOS 4 application. I have a ViewController that contains another class.
I have a view controller that houses a UIWebView. I want to display an
I have a viewController that autorotates just fine, The problem is that is I
I have created two viewController classes such that one is superclass of another.i have
I have a class that is viewcontroller and I'v putted it inside of tabbar.
The functionality I want is this: I have a set of URLs that I
Let's say I have a ViewController that needs access to a view. In the
I have several types os root view controller that I want to instantiate one
Ok hopefully this is an easy question: I have a main viewcontroller that is

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.