- // NSURL class is used to create an object which will hold the URL information.
- // NSURLRequest is used to create a request to the URL.
- // Method loadRequest of UIWebView is used to load the request in the UIWebView.
- -(void)viewDidLoad {
- UIWebView *webView =[[UIWebViewalloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height)];
- webView.scalesPageToFit= YES;
- NSString *urlAddress = @”http://www.google.com”;
- //Create a URL object.
- NSURL *url =[NSURL URLWithString:urlAddress];
- //URL Requst Object
- NSURLRequest *requestObj =[NSURLRequest requestWithURL:url];
- //Load the request in the UIWebView.
- [webView loadRequest:requestObj];
- }
↧
How to create and load URL in UIWebview in iOS?
↧