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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:54:25+00:00 2026-06-15T08:54:25+00:00

I have a tab bar application with several controllers. Some are UINavigationControllers , some

  • 0

I have a tab bar application with several controllers. Some are UINavigationControllers, some just simple UIViewControllers.
The central button presents the UIImagePickerController to allow the user to take a picture.
When I present the Image Picker from a simple UIViewControllers, it works fine.
But when I present it while a UINavigationController is currently the selectedViewController, the dismall of the picker removes the UINavigationBar of the controller.

I read that with UINavigationControllers, the modal view must be presented from the navigationController, but it does not work either.
Here are bunches of code :

    UIImagePickerController* picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    if (TARGET_IPHONE_SIMULATOR)
    {
        picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    }
    else
    {
        if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
        {
            picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        }
        else
        {
            UIAlertView* alert = [[UIAlertView alloc]
                                  initWithTitle:@"Erreur"
                                  message:@"Pour pouvoir poster des photos, votre device doit posséder un appareil photo"
                                  delegate:self
                                  cancelButtonTitle:@"OK"
                                  otherButtonTitles:nil];
            [alert show];
            return;
        }
    }
    if ([self.selectedViewController respondsToSelector:@selector(presentViewController:animated:completion:)])
    {
        [self.selectedViewController presentViewController:picker animated:YES completion:nil];
    }
    else
    {
        [self.selectedViewController presentModalViewController:picker animated:YES];
    }

the dismall :

[self.selectedViewController dismissModalViewControllerAnimated:YES];

Has anyone got this strange behavior (guess it has something to do with the fact that UIImagePickerController delegate must implement UINavigationControllerDelegate) and know how to resolve that?
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-15T08:54:26+00:00Added an answer on June 15, 2026 at 8:54 am

    You can redirect to pickerController using this

    [self presentViewController:picker animated:YES completion:^{}];  
    

    And its delegate method

    -(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
    {
        NSData *dataImage = UIImageJPEGRepresentation([info objectForKey:@"UIImagePickerControllerOriginalImage"],1);
        [picker dismissViewControllerAnimated:YES completion:^{}];
    }
    
    - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
    {
        [picker dismissViewControllerAnimated:YES completion:nil];
    }  
    

    Or

    Make sure that you are not setting any setHidden in your Code.

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

Sidebar

Related Questions

I have an application with several view controllers controlled from a tab bar controller.
I have developed an iPhone application with tab bar and navigation controllers. It is
I have a tab bar application with a navigation controller and view controllers inside
so I have a tab bar application where i have put a button to
i have a tab bar application, now what i want to do is to
I have a tab bar iPhone application with 4 tabs. In the Interface Builder
I have created an tab bar application having 3 tab. When I am launching
I have created a Tab Bar Application, removed the default FirstView and SecondView and
I am new to this iphone development.I have created a tab bar application which
I have a tab bar along with navigation controller iphone application. Now I need

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.