I would like my custom controller (opened by a UITabBarController) to immediately load a UIImagePickerControllerSourceTypeCamera as soon as it is loaded. To achieve this, I added a method - acquirePhoto() and I'm trying to call it from within the - viewDidLoad() but this is causing the error above.
This is the call:
- (void)viewDidLoad {
[super viewDidLoad];
[self aquirePhoto];
}
While this is the method:
- (void)acquirePhoto {
[[TopBarViewController instance]view].hidden = TRUE;
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[picker setDelegate:self];
[picker setAllowsEditing:NO];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
[picker release];
}