I followed this tutorial http://bytedissiden开发者_运维问答t.theconspiracy5.com/2010/11/24/uiwebview-tutorial/ and when I run the simulation in Xcode, all that is displayed is a blank white screen. I'm wondering what could be wrong. Is there some sort of code connection to the internet that i'm missing? I really don't know what could be wrong.
WebPageViewController.m #import "WebPageViewController.h"
@implementation WebPageViewController
@synthesize wView;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
//a URL string
NSString *urlAddress = @"http://www.nd.edu";
//create URL object from string
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Request Object created from your URL object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView
[wView loadRequest:requestObj];
//scale page to the device - can also be done in IB if preferred.
//wView.scalesPageToFit = YES;
}
Did you connect the .xib to the WebPageViewController class you created? You can check by selecting the .xib in the editor, and use identity inspector on 'File's Owner' in the Class field under Custom Class
精彩评论