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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:59:00+00:00 2026-06-18T01:59:00+00:00

I have a strange problem presenting the UIImagePickerController modally in my iOS 6 app.

  • 0

I have a strange problem presenting the UIImagePickerController modally in my iOS 6 app. The XCode gives me this error:

Warning: Attempt to present <UIImagePickerController: 0x1e025040> on <UINavigationController: 0x1d51ce00> whose view is not in the window hierarchy!

I have the following window hierarchy in my AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window = window;

    firstViewController = [[SGNewMailViewController alloc] init];
    navController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
    self.window.rootViewController = firstViewController;
    [self.window makeKeyAndVisible];
    return YES;
}

In my SGNewMailViewController I present a new UIView, a member of SGFoldingAttachmentView class which has this code in it:

- (void)choosePhotoPressed {
    SGNewMailViewController *mailVC = [((SGAppDelegate *)[UIApplication sharedApplication].delegate).firstViewController.navigationController.viewControllers lastObject];
    [mailVC displayCameraRoll];
}

In the end, here’s my SGNewMailViewController displayCameraRoll method:

- (void)displayCameraRoll {
    if ([UIImagePickerController isSourceTypeAvailable:
         UIImagePickerControllerSourceTypeSavedPhotosAlbum])
    {
        UIImagePickerController *imagePicker =
        [[UIImagePickerController alloc] init];
        imagePicker.delegate = self;
        imagePicker.sourceType =
        UIImagePickerControllerSourceTypePhotoLibrary;
        imagePicker.mediaTypes = [NSArray arrayWithObjects:
                                  (NSString *) kUTTypeImage,
                                  nil];
        imagePicker.allowsEditing = NO;
        [self presentViewController:imagePicker animated:YES completion:nil];
    }
}

So what can possibly be the problem? Is it in the custom view presented from another class? How should I fix it? Thanks in advance!

  • 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-18T01:59:00+00:00Added an answer on June 18, 2026 at 1:59 am

    Make the UINavigationController to be the root view controller of your window. This should fix the problem

    self.window.rootViewController = navController;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange problem. I made app with deployment target of iOS 6.0 I
I have this strange problem. In my app I'm asking the device, if DeviceMotion
I have a strange problem with in-app billing RESTORE_TRANSACTION command. Every request RESTORE_TRANSACTION request
I have a strange problem. I do this query in a node.js server using
I have strange problem. I developed app code signed it with Distribution provisioning profile
I know that this question has already been asked, but I have strange problem
Good day! I have strange problem with Xcode 4.3. When I'm trying to run
I have this strange problem. I have this script: echo $comment_content = $_POST['comment_content']; echo
I have this strange problem on my web page where if you click below
I have a strange problem with EasyMock This is the call I'm making which

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.