遵循的代理是:UIImagePickerControllerDelegate,UINavigationControllerDelegate
实现的代理方法是:
选了某一张照片后调用这个方法
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
}
点击相册界面 cancel 的触发方法
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
UIImagePickerController *picker =[[UIImagePickerController alloc]init];
picker.delegate =self;
设置类型(相册、摄像头)
picker.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
去系统的相片的界面 只能用 presntent
[self presentViewController:picker animated:YES completion:nil];