开发者

iPhone UIWebView - Calling loadHTMLString:baseURL: a second time doesn't do anything?

Is the -loadHTMLString:baseURL: method of UIWebView meant to only be called once per instance?

Here's my logic flow:

1.  View loads & supplies UIWebView placeholder text via -loadHTMLString:baseURL:
2.  NSURLConnection requests a URL asynchronously
3.  Upon NSURLConnection finished, replace UIWebView content with loaded data 
    via -loadHTMLString:baseURL:

Debugging shows that loadHTMLString:baseURL: is being called and the string being passed in is correct, but the UIWebView isn't updated. I even tried calling [webViewInstance setNeedsDisplay] thinking a redraw would fix it, but no dice.

In Apple Developer docs, it says nothing about the method being one-call-per-instance, but based on its behavior, this is what it seems 开发者_Python百科like. Anyone else run into this?


There's no limit on the number of times loadHTMLString: can be called. I call it hundreds of times on the same UIWebView in my app.

Did you implement webView:shouldStartLoadWithRequest:navigationType: ? If you did, make sure you return YES.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜