gpt4 book ai didi

html - 无法使用 loadHTMLString :baseURL in iOS? 在 UIWebView 中加载 html 字符串

转载 作者:太空狗 更新时间:2023-10-29 15:05:38 25 4
gpt4 key购买 nike

我正在尝试将 youtube 视频嵌入到我的 iOS 应用程序中。为此我创建了一个 UIWebView 并尝试从以下 here 加载 Youtube 视频

我已经完成了上述问题的所有答案。即使那样它也不起作用。我也试过加载非常简单的 HTML

 NSString *embedHTML =[NSString stringWithFormat:@"<html><body>Hello World</body></html>"];
[webView loadHTMLString:embedHTML baseURL:nil];

即便如此,我还是遇到编译错误 Parse Issue Expecte ']'

我尝试过清理、退出 XCode 并重新启动它。我不知道,我无法使用该方法。如何为我的 UIWebView 使用上述 loadHTMLString 方法。

附言:请不要将此问题标记为重复。我已经尝试了 Stackoverflow 中的所有解决方案。没有任何效果

最佳答案

WebView *webDesc = [[UIWebView alloc]initWithFrame:CGRectMake(12, 50, 276, 228)];

NSString *embedHTML = @"<html><head></head><body><p>1. You agree that you will be the technician servicing this work order?.<br>2. You are comfortable with the scope of work on this work order?.<br>3. You understand that if you go to site and fail to do quality repair for any reason, you will not be paid?.<br>4. You must dress business casual when going on the work order.</p></body></html>";

webDesc.userInteractionEnabled = NO;
webDesc.opaque = NO;
webDesc.backgroundColor = [UIColor clearColor];
[webDesc loadHTMLString: embedHTML baseURL: nil];

关于html - 无法使用 loadHTMLString :baseURL in iOS? 在 UIWebView 中加载 html 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17155458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com