1

Xcode 新手,我的编码有什么问题?

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
Webview.userInteractionEnabled = TRUE;
[UIWebView loadRequest: [[[NSURLRequest alloc] initwithURL:[[NSURL alloc] initWithString:@"http://www.reddit.com/r/Diecast/"]]];
[super viewDidLoad];

请帮忙,如果我做错了什么,请纠正我!我正在尝试为该特定页面制作浏览器,以便人们可以打开图片并浏览该页面。

谢谢!

4

2 回答 2

2

检查您的大小写-initWithURL:

此外,您需要调用loadRequest:您的 Web 视图实例,而不是类UIWebView

NSURL *url = [[NSURL alloc] initWithString:@"http://www.reddit.com/r/Diecast/"];
NSURLRequest *request = [NSURLRequest alloc] initWithURL:url];
[Webview loadRequest:request];
于 2013-04-11T01:01:32.287 回答
0

尝试这个

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
Webview.userInteractionEnabled = YES;
[Webview loadRequest: [[[NSURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"http://www.reddit.com/r/Diecast/"]]];
于 2013-04-11T01:02:07.913 回答