Rani
Rani

Reputation: 3453

How to open web page in web view on iPhone

I want to open web page on the webView by passing the web url of that page. How is this possible?

Upvotes: 3

Views: 15838

Answers (1)

WrightsCS
WrightsCS

Reputation: 50707

You can load a website using this:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://i.wrightscs.com"]]];

You can also load HTML into a UIWebView using this:

[webView loadHTMLString:@"<strong>It Work's!</strong>" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];

Upvotes: 8

Related Questions