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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:57:20+00:00 2026-05-15T16:57:20+00:00

I have what I believe is a fairly simple application at the moment based

  • 0

I have what I believe is a fairly simple application at the moment based on a few tutorials cobbled together. I’m using XCode 3.2.3 in OSX 10.6.4. It started as a standard iPhone “Window Based Application”. Using interface builder I have added a Tab Bar Controller using the O’Reilly video tutorial here:

http://broadcast.oreilly.com/2009/06/tab-bars-and-navigation-bars-t.html

In the first Tab I have a standard UIView with two buttons. Both call the same function to display a UIImagePickerController:

-(IBAction) btnPhotoClicked:(id)sender {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
if((UIButton *)sender == btnChoosePhoto)
{
    imagePicker.allowsEditing = YES;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
}

[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
}

I am running the code inside an emulator so only ever click the button called Choose Photo. When the dialogue is released with a photo chosen this function runs:

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary  *)info {
NSURL *mediaUrl;

mediaUrl = (NSURL *)[info valueForKey:UIImagePickerControllerMediaURL];

if (mediaUrl == nil)
{
    imagePuzzle = (UIImage *) [info valueForKey:UIImagePickerControllerEditedImage];
    if(imagePuzzle == nil)
    {
        //--- Original Image was selected ---
        imagePuzzle = (UIImage *) [info valueForKey:UIImagePickerControllerOriginalImage];
    }
    else {
        //--- Get the edited image ---
        //--- If it was successful the above valueForKey:UIImagePickerControllerEditedImage
        //--- would have assigned it already.
    }
}
else {
    //--- Muppet selected a video
}

// Animate the picker window going away
[picker dismissModalViewControllerAnimated:YES];
ImageViewController *imageViewController = [[ImageViewController alloc] init];
imageViewController.delegate = self;    
[self presentModalViewController:imageViewController animated:YES];
[imageViewController release];
}

This is where my problem lies. I’ve tried many different hacks and iterations but the above code is the simplest to present the problem. When the imageViewController is displayed as a modal dialogue the following exception is thrown:

2010-07-09 15:29:29.667 Golovomka[15183:207] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal
transition from <NewViewController: 0x5915f80> to <ImageViewController: 0x594a350>     
while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear
to know the current transition has completed'

How do I cure this? I have tried delays and other tricks but do not really understand how I’m supposed to use viewDidAppear or viewDidDisappear to help me. Also of note is that a very basic application with one view loading the picker then displaying another view with the image in does not produce the error. Any help gratefully received.

  • 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-15T16:57:21+00:00Added an answer on May 15, 2026 at 4:57 pm

    To address the specific issue described here, you could add the viewDidAppear method in your class:

    -(void)viewDidAppear:(BOOL)animated
    {
        if (/*just visited ImagePicker*/)
        {
            ImageViewController *imageViewController = [[ImageViewController alloc] init];
            imageViewController.delegate = self;    
            [self presentModalViewController:imageViewController animated:YES];
            [imageViewController release];
        }
    }
    

    Remove those lines from below your call:

    [picker dismissModalViewControllerAnimated:YES];
    

    So, whenever your class self appears (is displayed), it will call viewDidAppear… Since this most likely isn’t really what you want all the time, you could add some variables to set/clear that defines whether or not to immediately present the imageViewController when self is displayed. Something like “If coming from image picker, show the imageViewController, otherwise do nothing”.

    That said, imho, pushing modal views is should generally be done in response to a user action and I would maybe rethink the user experience here – e.g. add a subview instead of pushing a modal view which you could do where your currently have the code – but if you’re just playing around with some tutorials that should solve the NSInternalInconsistencyException. 🙂 Cheers!

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

Sidebar

Related Questions

I believe this is a fairly simple question but I have no idea where
I have what I believe is a killer idea for an application. By definition,
I am (unfortunately) developing an application in Excel 2000 VBA. I believe I have
Have just started using Google Chrome , and noticed in parts of our site,
I believe that I have successfully impersonated my own user account while running an
I believe several of us have already worked on a project where not only
I have two issues both related to (I believe) my SQL Server setup. I
I have been told and I'm not sure I believe this: Removing white space
I have an Oracle server (version 9, I believe) and a MS SQL server
Just out of curiosity, for applications that have a fairly complicated module tree, would

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.