webViewDidFinishLoad没有使用loadHTMLString调用

时间:2013-07-06 21:47:53

标签: objective-c uiwebview

因此,当应用启动时会加载

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>

1 个答案:

答案 0 :(得分:1)

要使用UIWebViewDelegate方法,您可以将UIWebView委托与File's Owner ....联系起来。 enter image description here