iPhone - webViewDidFinishLoad未调用 [英] iPhone - webViewDidFinishLoad not called

查看:221
本文介绍了iPhone - webViewDidFinishLoad未调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的视图到IB,只包含一个UIWebView和一个UIButton。

webView保留,连接,不是nil,委托属性os也连接,控制器 UIWebViewDelegate 并且在ViewDidLoad中的.h。

中设置,我使用 [self.webView loadHTMLString:htmlContent baseURL:nil] ;

I have a simple View into IB that contains just a UIWebView and a UIButton.
The webView is retained, connected, not nil, the delegate property os also connected, the Controller is UIWebViewDelegate compliant and set in the .h.
in ViewDidLoad, I use [self.webView loadHTMLString:htmlContent baseURL:nil];

内容加载,但 webViewDidFinishLoad didFailLoadWithError , webViewDidStartLoad

The content loads, but webViewDidFinishLoad is never triggered, neither didFailLoadWithError, neither webViewDidStartLoad.

已完成加载,因为它需要很短的时间,但仍然是一个时间加载(我需要在显示的时间内做一些事情,例如不显示按钮)?

How can I know when my content has finished loading, as it take a short time, but still a time to load (and I need to do things during that time on display, for an example not showing the button) ?

@interface MyController : UIViewController <UIWebViewDelegate> {
    UIWebView* webView;
}

@property (nonatomic, retain) IBOutlet UIWebView* webView;

@end


@implementation MyController

@synthesize webView;

- (void)viewDidLoad
{
[super viewDidLoad];

constructing the htmlString

id a = self.webView.delegate; // for debug
[self.webView loadHTMLString:htmlContent baseURL:nil];
}

@end

/ strong>
我删除了整个XIB并从scrathc构建它:没有更多的问题。

EDIT : I've deleted the whole XIB and built it from scrathc : no more problem. IB sucks sometimes.

推荐答案

我删除了整个XIB并从头开始重建:没有更多的问题。有时会吸引IB。

I've deleted the whole XIB and built it again from scratch : no more problem. IB sucks sometimes.

这篇关于iPhone - webViewDidFinishLoad未调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆