views:

29

answers:

2

I am trying to display a web page in UIWebView so that when i click a button the webpage should be displayed in uiWebview.How could this be possible Can anybody help in solving this or give me some hint

A: 

UIWebView tutorial

Alex Reynolds
thankx for u r answer
Pradeep
A: 

You should have a look at the documentation for UIWebView.

There are two ways of doing this. The method you choose depends on where the data is coming from. If you're loading the data from a string, use:

NSURL* base = [NSURL URLWithString: @"http://..."];
[myWebView loadHTMLString: @"some html here" baseURL: base];

When loading HTML from a string the UIWebView needs to know the base URL for any relative URLs within the document, hence the baseURL: parameter.

If the data is accessible via a URL, use:

NSURL* url = [NSURL URLWithString: @"http://..."];
NSURLRequest* request = [NSURLRequest requestWithURL: url];
[myWebView loadRequest: request];
Bryan Kyle