Blank Page in UIView

Refresh

December 2018

Views

83 time

2

I created a simple app with a web view but it doesn't appear. Only a blank page is shown. My .xib contains the UIWebView

My file ViewController.h:

#import <UIKit/UIKit.h>

@interface TestAViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webview;

@end

My file ViewController.m:

#import "TestAViewController.h"

@interface TestAViewController ()

@end

@implementation TestAViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

        // Custom initialization
    }

    return self;
}

- (void)viewDidLoad
{
    // Do any additional setup after loading the view, typically from a nib.

    //load url into webview
    NSString *strURL = @"http://www.google.it";
    NSURL *url = [NSURL URLWithString:strURL];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [self.webview loadRequest:urlRequest];


}

@end

Why is this happening? Thanks.

0 answers