webViewDidFinishLoad不会被调用与loadHTMLString(webViewDi

2019-10-18 07:59发布

因此,这将加载应用程序启动时

NSString *youTubeVideoHTML = [NSString stringWithFormat:@"<html><head>"
"<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 200\"/></head>"
"<body style=\"background:#FFFFF;margin-top:0px;margin-left:0px\">"
"<div><object width=\"320\" height=\"200\">"
"<param name=\"wmode\" value=\"transparent\"></param>"
"<embed src=\"http://www.youtube.com/v/%@&app=youtube_gdata\""
"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"200\"></embed>"
"</object></div></body></html>", [[NSUserDefaults standardUserDefaults] objectForKey:@"detailVideoURL"]];
[self.webView loadHTMLString:youTubeVideoHTML baseURL:nil];

Althogh的webViewDidFinishLoad没有被调用,没有任何人有任何想法,为什么这是怎么回事?,我已经添加了UIWebViewDelegate

@interface DetailViewController : UIViewController <UIWebViewDelegate>

Answer 1:

要获得工作UIWebViewDelegate方法来连接UIWebView与委托File's Owner ....



文章来源: webViewDidFinishLoad not being called with loadHTMLString