Blank Page in UIView


December 2018


83 time


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;


My file ViewController.m:

#import "TestAViewController.h"

@interface TestAViewController ()


@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 = @"";
    NSURL *url = [NSURL URLWithString:strURL];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [self.webview loadRequest:urlRequest];



Why is this happening? Thanks.

0 answers