I am trying to get a UIWebView to display google.com for now, but its not loading:
I just get a blank screen
.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *targetURL = [NSURL URLWithString:@"http://www.google.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[_webView loadRequest:request];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
What I did is the following to create a web view:
- Created a new UIViewController scene
- Added a UIWebView to it
- connected the webview to .h controller
- Made my scene the inital scene
- Ran the app, nothing was loaded, no errors, just go straight to UIViewController with nothing in it, please help.
I tried adding the following:
[self.view addSubview:self.webView];
That did nothing