English 中文(简体)
缩略语
原标题:xcode UIWebView loader code HTML

我提出了一个网上装货的问题:

我制作了一份Json文件,以获得言语表和良好工作,但在内容表内,一只能够在一条线上获得纯超文本,这样,如果网络要求装上标准代码等内容,一看内容,只能看内容,而只是带有标签的纯密码:

[MyWeview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:MyJsonClass.MyContentTeble ]]];

This normal code working, but not to encode HTML, i will get code like:

NSString *HTMLData = @"<iframe></iframe>";
[palinsesto loadHTMLString:HTMLData baseURL:nil];

但我的代码“@”来自MyJsonClass。 MyContent 表1

得到帮助。

页: 1

如果你试图使用该法典的话,请回答白,但仍未奏效:

[MyWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:MyJsonClass.MyContentTeble ]]];

工作,但可以看看内容。

我尝试你的法典,并建造了好东西,但在触动可贵的单元后坠毁。

想像在应用中需要一位学者读并编成一种简单的超文本,但从来不去<代码><html>andt;/one></html> tags T_T,因为从Mysql DB的“压力表”获得纯密码和茶。

任何其他想法?

问题回答

您可尝试:

[web loadHTMLString: @ "<html> <body> <iframe src =  http://www.example.com , style =  border-width: 0  width =  100%  height =  480  frameborder =  0  scrolling =  no  > </ iframe> </ body> </ html> "baseURL: nil];

- (BOOL) WebView: (UIWebView *) WebView shouldStartLoadWithRequest: (NSURLRequest *) request navigationType: (UIWebViewNavigationType) {navigationType
     if ([request.URL.absoluteString rangeOfString: @ "www.example.com"]. location! = NSNotFound) {
     NSLog (@"%@", [WebView stringByEvaluatingJavaScriptFromString: @ "document.body.innerText"]);
     return NO;
     }
     return YES;
}

这是一个想法。

我希望你能够帮助





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签