iPhone 应用程序网络视图未出现在设备上
我有一个视图控制器,在视图确实加载方法中,我
- (void)viewDidLoad
{
self.navigationItem.title=@"Twitter Profile";
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 370.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @"http://twitter.com/#!/SummerApps";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
[webView release];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
在模拟器中有这段代码,一切正常,但在设备上,页面无法加载。 我在 Facebook 的另一个视图上也有相同的代码,它工作正常,链接是唯一的区别!有什么帮助吗?
i have a view controller and in view did load method i have this code
- (void)viewDidLoad
{
self.navigationItem.title=@"Twitter Profile";
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 370.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @"http://twitter.com/#!/SummerApps";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
[webView release];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
in simulator everything works fine but on device the page just doesn't load.
I also have the same code on another view for facebook and it works fine the link is the only difference! Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的 webView 与插座连接了吗?或检查模拟器中的互联网设置。
have you connected your webView with outlet connection ? or check your internet setting in Simulator.
那么,当我在我的 i 设备上使用 Safari 打开相同的链接时,会弹出一个警报,告诉我该证书不受信任,如果我单击“确定”然后它会加载?你知道发生了什么事吗?我想这就是为什么它无法在我的内置网络视图中加载的原因
Well when i open the same link with safari on my i-device pops up an alert that tells me that the certificate is not trusted if i click ok then it loads? Do you know whats going on i think that's why it doesn't load in my built in web view