I created a UIImagePickerController in the viewDidLoad method in my rootViewController.
- (void)viewDidLoad {
[super viewDidLoad];
UIImagePickerController *pickerController=[[UIImagePickerController alloc] init];
pickerController.sourceType=UIImagePickerControllerSourceTypeSavedPhotosAlbum;
pickerController.delegate=self;
[self presentModalViewController:pickerController animated:YES];
[pickerController release];
}
But the view of UIImagePickerViewController didn’t appear on the screen.
The SDK version is 4.3
Is there some mistakes i make?
Thanks!
viewDidLoadis called after the view has been loaded and before the view is displayed.viewDidAppear:is called when the view is onscreen and is the correct point to present a modal view controller.And if you want to do it only once, you might want to consider using a
BOOLto keep track of it.