ios8 iPad uiwebview crashes while displaying popover when user taps drop down list HTML select tag

前端 未结 5 1670
生来不讨喜
生来不讨喜 2020-11-30 21:00

On ios8 and iPad if a uiwebview is displaying a HTML page containing a drop down list

eg this page http://www.w3schools.com/tags/tryit.asp?filename=tryh

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 21:12

    The solution mentioned in the question did not help me, however it did point me in the right direction. After some investigation I would say it's some sort of race condition between presenting and removing the popover. As a workaround you can postpone the presentation in the delegate of the UIWebView:

    -(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
    {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_USEC), dispatch_get_main_queue(),
                   ^{
                       [super presentViewController:viewControllerToPresent animated:flag completion:completion];
                   });
    }
    

提交回复
热议问题