因此,当应用启动时会加载
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>
答案 0 :(得分:1)
要使用UIWebViewDelegate
方法,您可以将UIWebView
委托与File's Owner
....联系起来。