user142764
user142764

Reputation: 1903

UIImagePicker camera not loading (white screen)

I have troubles using UIImagePicker to take pictures based on the "Taking Pictures with the Camera" chapter from the iPhone programming guide.

Whatever i try all i get is a grey/white screen.

here is my code :

- (void)viewDidLoad {
    [super viewDidLoad];

    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.allowsEditing = NO;
    [self presentModalViewController:imagePicker animated:YES];
}

I've tried to call the imagePicker from the viewDidLoad, viewWillAppear or awakeFromNib, nothing changes.

My viewController implements UINavigationControllerDelegate and UIImagePickerControllerDelegate.

I'm running this on OS3.1 on a first gen iPhone.

Any help would be greatly appreciated ! Thanks, Vincent.

Upvotes: 1

Views: 1208

Answers (1)

IphoneDev
IphoneDev

Reputation: 93

I would placing that call in viewDidAppear as oposed to viewDidLoad.

Upvotes: 5

Related Questions