3

I am trying to display a MPMediaPickerController in a popover on iOS7+ and it is VERY slow. It takes about 4 seconds from the first NSLog to the second NSLog. I have tried retaining the picker but this makes no difference. Any ideas would be greatly appreciated.

- (void) showMediaPickerControllerWithArrowDirection:(UIPopoverArrowDirection)arrow_direction
{
    MPMediaPickerController *self.picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio];

    self.picker.modalPresentationStyle = UIModalPresentationPopover;
    self.picker.delegate = self;
    self.picker.allowsPickingMultipleItems = YES;

    UIPopoverPresentationController *popPresenter = self.picker.popoverPresentationController;
    popPresenter.sourceView = self.view;
    popPresenter.sourceRect = self.view.bounds;
    popPresenter.permittedArrowDirections = arrow_direction;

    NSLog(@"____________________________  about to launch picker ");

    [self.viewController presentViewController:self.picker animated:YES completion:^{
        NSLog(@"____________________________  picker launched ");
    }];
}
amergin
  • 3,106
  • 32
  • 44

0 Answers0