Reputation: 2314
I'm new for iOS develop. I tried to make a very simple app just show a UIWebView which display a web page:
ViewController.m:
#import "ViewController.h"
@implementation ViewController
@synthesize webView = _webView;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *urlAddress = @"http://jsfiddle.net/emj365/qaQnF/embedded/result/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestObj];
}
...
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
UIWebView * _webView;
}
@property (nonatomic, retain) IBOutlet UIWebView * webView;
@end
UIWebView show blank. What's wrong?
Upvotes: 1
Views: 1454
Reputation: 12081
There are a few different things that could go wrong. A few options you should check:
UIWebView
delegate and check for (networking) errorsUpvotes: 1