Why does UIImagePickerControllerSourceTypePhotoLibrary not allow the user to select an album?

I am currently developing an iPad application for the iPad where I use the UIPopOverController in combination with the UIImagePickerController so that the user can select the image from their iPad (with the original type UIImagePickerControllerSourceTypeSavedPhotosAlbum). This works great and as expected, but allows the client to view the SavedPhotos album. If I changed the collector to use UIImagePickerControllerSourceTypePhotoLibrary, the window will still display its albums, but it will be static (this means that I can scroll, but I can not select albums, and when I scroll down or up, the view will only pop back if I will touch the screen again).

Do I need additional settings to work with PhotoLibrary? I tried a lot of approaches, but I'm out of luck here.

Customization is an OpenGL view in which I run UIPopOverController with UIImagePicker. For clarity, here is the code:

-(void)showPicker { if(![pController isPopoverVisible]) { [pController presentPopoverFromRect:CGRectMake(50,100,200,300) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES]; } else { pController dismissPopoverAnimated:YES]; } } -(void)awakeFromNib { picker = [[UIImagePickerController alloc] init]; pController = [[UIPopoverController alloc] initWithContentViewController:picker]; // Code works properly if I only set it to UIImagePickerControllerSourceTypeSavedPhotosAlbum if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; else if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) picker.sourceType =UIImagePickerControllerSourceTypeSavedPhotosAlbum; else { NSLog(@"Error: Could not pick appropriate sourceType"); } picker.mediaTypes = [NSArray arrayWithObjects:(NSString*)kUTTypeImage, nil]; picker.delegate = self; pController.delegate = self; picker.allowsEditing=NO; } 
+4
source share
1 answer

Do you work with iOS6? I know that in settings / privacy you should allow your application to see in photo albums.

0
source

Source: https://habr.com/ru/post/1441786/


All Articles