webViewDidFinishLoad not being called with loadHTMLString

元气小坏坏 提交于 2020-01-05 04:52:31

问题


So this loads when the app launches

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 the webViewDidFinishLoad is not being called, does anyone have any idea why that's happening ?, I've already added the UIWebViewDelegate.

@interface DetailViewController : UIViewController <UIWebViewDelegate>

回答1:


To get working with UIWebViewDelegate methods you to connect UIWebView delegate with the File's Owner....



来源:https://stackoverflow.com/questions/17507450/webviewdidfinishload-not-being-called-with-loadhtmlstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!