UIImagePickerController not working with 2.2 SDK

Discussion in 'iPhone/iPad Programming' started by sspbond007, Nov 24, 2008.

  1. macrumors member

    #1
    Hi All,

    i've updated to 2.2 SDK + iPhone OS. Now when I am adding photo to my application from album or using camera, it gives following error message

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'

    2008-11-24 16:43:22.461 IphoneSurveyTool89:20b Stack: (

    808221155,

    806100816,
    here is the code I'm using..

    UIImagePickerController *imagePickerController = [UIImagePickerController alloc] init ;

    if(UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera){
    imagePickerController.delegate = self;
    imagePickerController setSourceType:UIImagePickerControllerSourceTypeCamera;
    homeViewController.navigationController pushViewController:imagePickerController animated:YES;
    homeViewController.navigationController.navigationBarHidden = YES;
    }
    else{
    imagePickerController.delegate = self;
    imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary;
    homeViewController.navigationController pushViewController:imagePickerController animated:YES;
    homeViewController.navigationController.navigationBarHidden = YES;
    }
    imagePickerController release;

    The code was working perfectly fine with 2.1 SDK and iPhone OS.
     

Share This Page