tags:

views:

17

answers:

1

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];
}
+1  A: 

In viewDidLoad you have used "aquirePhoto" and the method name is "acquirePhoto". You are missing a "c" in viewDidLoad. Is this a typo here or that is actually missing in the code?

taskinoor
Ops! Thanks, it was actually missing from the code :)