在iOS 4.3中未调用UIWebView shouldStartLoadWithRequest

UIWebView shouldStartLoadWithRequest not called in iOS 4.3

本文关键字:调用 UIWebView shouldStartLoadWithRequest iOS      更新时间:2023-09-26

UIWebView的shouldStartLoadWithRequest是由带有的javascript触发的

window.location = updateappdata://type/viewName/;

它在ios 5.0、5.1、6.0 中运行良好

然而,在ios 4.3中,只调用了一些updateappdata://回调,而不是所有的shouldStartLoadWithRequest都被调用。有什么想法吗?

通过子视图将uiwebviews滚动视图的委托设置为viewcontroller时出现问题。

if ([[subview class] isSubclassOfClass: [UIScrollView class]])
{
     [((UIScrollView *)subview) setDelegate: self];
}

由于iOS 5.0+中有.scrollView属性,因此一切都正常。