You use UIImagePickerController
directly:
UIImagePickerController *thePicker = [[UIImagePickerController alloc] init];
thePicker.delegate = thePickerDelegate;
thePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
//Here you would present thePicker modally, and release it after this
//It will be deallocated when you remove it from screen
[anotherViewController presentModalViewController: thePicker animated:NO];
[thePicker release];
In the thePickerDelegate
, implement
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo;
The image
is the picture you took, and you can manipulate it as you wish. If you want the UIImagePickerController
to dissapear after taking one photo, this is where you would trigger this action, and remove it from screen, in the modal case presented above, by calling
[thePicker dismissModalViewControllerAnimated: NO];