Try this out.
In the viewDidLoad method, initialize the UIImagePickerController, assign its property sourceType as UIImagePickerControllerSourceTypeCamera and delegate as self.
Define a button in your view controller where on its click event get the modal view of the imagepicker, like:
[self presentModalViewController:self.picker animated:YES];
here picker is the object of UIImagePickerController.
Next,implement the didFinishPickingMediaWithInfo delegate of UIImagePickerController. In this delegate, you can assign a UIImage to the Dictionary object info, then save the image to your local instance of UIImageView(its ImageToSave below)
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
UIImage *img = [info objectForKey:@"UIImagePickerControllerImage"];
ImageToSave.image = img;
}
Do not forget to include the UIImagePickerControllerDelegate into your main view controller's .h file.
See if this works or not.