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=tryhtml_select
then
- repeatedly tap on the HTML drop down list that contain lists of cars . first item is Volvo.
- tap every 1/2 second or so that uipopover opens and closes
- app will crash:
Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController () should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
Is there anyway to work around this in uiwebview
in ios8?
It doesn't happen using wkwebview
, but I would like to fix it in uiwebview
.
Update: This seems to help but unsure of side effects. I have overridden the following in the view controller that contains the uiwebview.
-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
{
if (completion)
{
completion();
}
[super dismissViewControllerAnimated:NO completion:nil];
}