選中某個圖片後,顯示出來。- (void)showPicker{UIImagePickerController *picker = [[UIImagePickerController alloc] init];picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;picker.delegate = self;[self presentModalViewController:picker animated:YES];[picker release];}// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.- (void)viewDidLoad { [super viewDidLoad];UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect];button.frame = CGRectMake(10.0f, 60.0f, 120.0f, 30.0f);[button setTitle: @"Picker" forState: UIControlStateNormal];[button addTarget: self action: @selector(showPicker) forControlEvents: UIControlEventTouchUpInside];[self.view addSubview: button];m_imageView = [[UIImageView alloc] initWithImage: nil];m_imageView.frame = CGRectMake(120.0f, 120.0f, 60.0f, 60.0f);[self.view addSubview: m_imageView];}#pragma mark delegate- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)aImage editingInfo:(NSDictionary *)editingInfo{m_imageView.image = aImage;[picker dismissModalViewControllerAnimated:YES];}