UIWebView显示问题

时间:2011-09-26 14:53:35

标签: uiwebview

我遵循了本教程http://bytedissident.theconspiracy5.com/2010/11/24/uiwebview-tutorial/,当我在Xcode中运行模拟时,所有显示的都是一个空白的白色屏幕。我想知道什么是错的。是否存在某种我错过的互联网代码连接?我真的不知道会出现什么问题。

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;

}

1 个答案:

答案 0 :(得分:0)

您是否将.xib连接到您创建的WebPageViewController类?您可以在编辑器中选择.xib进行检查,并在自定义类

下的类字段中的“文件所有者”上使用身份检查器
相关问题