我试图通过将URL链接到按钮来从DashboardViewController打开网页。我有以下代码:
- (IBAction)facebook:(id)sender {
[[DashboardViewController sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com"]];
}
然而,这会引发错误:
[DashboardViewController sharedApplication]: unrecognized selector sent to class 0xaba8
2013-04-22 23:23:35.264 LoginScreen[37692:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[DashboardViewController sharedApplication]: unrecognized selector sent to class 0xaba8'
有人可以帮帮我吗?
答案 0 :(得分:2)
以下是您问题的解决方案 -
使用UIWebView,您可以将其添加为任何其他视图的子视图,然后使用您的URL调用loadRequest。