H
H
Habitat Horsewithyou2015-11-17 11:52:41
Apple Xcode
Habitat Horsewithyou, 2015-11-17 11:52:41

Loading photo from camera roll in ImageView Xcode?

How to correctly load a photo into ImageView from the camera roll of the phone itself? (When you click on the button, of course)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Marunko, 2015-11-18
@Antonio-banderas

#import "ViewController.h"
@implementation ViewController
@synthesize imageView;
#pragma mark -
#pragma mark IBActions
- (IBAction) didTapButton:(id)sender
{
UIImagePickerController *pickerController = [[UIImagePickerController alloc]
init];
pickerController.delegate = self;
[self presentModalViewController:pickerController animated:YES];
}
#pragma mark -
#pragma mark UIImagePickerControllerDelegate
- (void) imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary editing *)editingInfo
{
self.imageView.image = image;
[self dismissModalViewControllerAnimated:YES];
}
@end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question