本地图片选择
UIImagePickerController * ipc = [[UIImagePickerController alloc]init];
ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
ipc.delegate = self;
[self presentViewController:ipc animated:YES completion:nil];
[ipc release];
UIImagePickerControllerDelegate
把代理函数写上
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
_imageView.image = nil;
UIImage * image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
_imageView.image = image;
[picker dismissViewControllerAnimated:YES completion:nil];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[picker dismissViewControllerAnimated:YES completion:nil];
}