tags:

views:

21

answers:

2

Hi,

I want to present a modalViewController(do some picture drawing) right after dismiss the imagePickerController(exactly after finish image picking). I've tried to set up a IBAction with a bar button and it works fine when I tap it. But what I want is present the modalViewController as soon as I finish the image picking Here is my code:

-(void)imagePickerController:(UIImagePicerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info{

    [self dismissModalViewControllerAnimated:YES]; 
    //dismiss the imagePickerController
    drawViewController *drawView = [[drawViewController alloc] init];
    [self presentModalViewController:drawView animated:YES];
  }

Thanks!

+1  A: 

The dismiss and presentModal can't both animate in the same method. The presentModal will seem to do nothing. For the dismiss, try setting the animated to NO.

aBitObvious
Hi, thank you so much for the solution you just gave, it works perfect now!
Viper
A: 

After dissmissing the imagePickerController the viewDidAppear is called. You can there call the drawViewcontroller.

    -(void)viewDidAppear:(BOOL)animated{
       drawViewController *drawView = [[drawViewController alloc] init];
       [self presentModalViewController:drawView animated:YES];

    }
Ilija