iphone/ipad选取本地照片方法
1、iphone选取本地照片方法
UIImagePickerController *imagePickController = [[UIImagePickerController alloc]init];
imagePickController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//picker.allowsEditing = YES;
UIImagePickerController* iPickerController = [[[UIImagePickerControlleralloc] init] autorelease];
if ([UIImagePickerControllerisSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary]) {
iPickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
iPickerController.delegate = self;
[iPickerController setAllowsEditing:NO];
UIPopoverController *popover = [[UIPopoverControlleralloc] initWithContentViewController:iPickerController];
self.popoerController = popover;
[popover presentPopoverFromRect:CGRectMake(180, 380, 180, 10) inView:self.viewpermittedArrowDirections:UIPopoverArrowDirectionDownanimated:YES];
[popover release];
}