Atraso imprevisível antes do UIPopoverController aparecer no iOS 8.1

Esse problema ocorre no SDK 8.1, quando executado no iOS 8.1, mas não no iOS 7. É apenas para iPad. O problema aparece no simulador e em um dispositivo de hardware.

O código abaixo demonstra um controlador de exibição que contém um UITableView com 1 linha e, abaixo disso, um UIButton. Tocar no botão ou na linha fará com que uma popover apareça. Isso funciona bem ao tocar no botão, mas ao tocar na linha da tableview, a popover aparece com algum atraso. Nos meus testes, pela primeira vez que toco na linha, a popover geralmente aparece com pouco ou nenhum atraso, mas na segunda vez que toco na linha, pode demorar muitos segundos até que a popover apareça e, muitas vezes, não aparece até tocar em outro lugar a vista. No entanto, o atraso pode ocorrer mesmo no primeiro toque na linha (especialmente quando testado em hardware).

O código que eu mostro foi resumido o máximo possível, mantendo o problema. Parece-me que o UITableView é de alguma forma crítico para causar esse atraso.

Sei que parte do código UIPopoverController foi descontinuada no iOS 8. Tentei usar o UIPopoverPresentationController para iOS 8 e o resultado é o mesmo: Às vezes, um atraso muito longo antes do popover aparece. Ainda não estou muito familiarizado com essa nova abordagem, portanto, posso estar cometendo erros, mas, em qualquer caso, o código do iOS 8 pode ser testado definindo a macro USE_TRADITIONAL_METHOD como 0 em vez de 1.

Todas as sugestões sobre como corrigir ou contornar isso (enquanto ainda estiver usando uma tableview) serão muito apreciadas.

#import "MyViewController.h"

@interface MyViewController ()

@property (nonatomic) UIPopoverController* myPopoverController;

@end

@implementation MyViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    // setup table view
     UITableView* tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 500, 500) style:UITableViewStyleGrouped];
    [self.view addSubview:tableView];
    tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    tableView.dataSource = self;
    tableView.delegate = self;
    
    // setup button
    UIButton* button = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.view addSubview:button];
    button.frame = CGRectMake(20, 550, 100, 20);
    [button setTitle:@"Show popover" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(showPopover:) forControlEvents:UIControlEventTouchUpInside];
}


- (IBAction)showPopover:(id)sender
{
    UIView* senderView = (UIView*)sender;
    
    UIViewController* contentViewController = [[UIViewController alloc] init];
    contentViewController.view.backgroundColor = [UIColor purpleColor];
    
#define USE_TRADITIONAL_METHOD 1

#if USE_TRADITIONAL_METHOD
    self.myPopoverController = [[UIPopoverController alloc] initWithContentViewController:contentViewController];
    [self.myPopoverController presentPopoverFromRect:senderView.frame inView:senderView.superview permittedArrowDirections:UIPopoverArrowDirectionLeft animated:NO];
#else
    contentViewController.modalPresentationStyle = UIModalPresentationPopover;

    [self presentViewController:contentViewController animated:NO completion:^{
        NSLog(@"Present completion");       // As expected, this is executed once the popover is actually displayed (which can take a while)
    }];

    // do configuration *after* call to present, as explained in Apple documentation:
    UIPopoverPresentationController* popoverController = contentViewController.popoverPresentationController;
    popoverController.sourceRect = senderView.frame;
    popoverController.sourceView = senderView;
    popoverController.permittedArrowDirections = UIPopoverArrowDirectionLeft;
    
#endif
    NSLog(@"Popover is visible: %d", self.myPopoverController.isPopoverVisible);    // This shows "1" (visible) for USE_TRADITIONAL_METHOD, under both iOS 7 and iOS 8
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.textLabel.text = @"Show popover";
    return cell;
}

#pragma mark - UITableViewDelegate

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self showPopover:[tableView cellForRowAtIndexPath:indexPath]];
}


@end

questionAnswers(3)

yourAnswerToTheQuestion