Loading HTML into a Cocoa app with WebView and change text

Posted by Domness on Stack Overflow See other posts from Stack Overflow or by Domness
Published on 2010-12-29T12:28:40Z Indexed on 2010/12/29 12:54 UTC
Read the original article Hit count: 188

Filed under:
|
|

Right, so far I've got this for loading up a HTML file from within my app:

NSString *path1 = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"html"];
NSString *html = [NSString stringWithContentsOfFile:path1 encoding:NSUTF8StringEncoding error:nil];
[[webView mainFrame] loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]bundlePath]]];

Which works loading the file up into the app's WebView. But I want to change some values in the HTML (or PHP if it works by using $_REQUEST/$_GET), for example, I have a table with some text in it and I want to change this text from an NSString etc.

How would I go about this?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa