0

I am trying to open a webpage from a DashboardViewController by linking the URL to a button. I have the following code:

- (IBAction)facebook:(id)sender {
    [[DashboardViewController sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com"]];
}

However this throws the error:

[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'

Can someone please help me with this?

spatra
  • 151
  • 1
  • 3
  • 10
  • 1
    This has absolutely nothing to do with Xcode. Also, there are dozens of duplicates of this question. You need to learn the basics of Objective-C. –  Apr 23 '13 at 04:34
  • Thanks, I saw this question multiple times but none addressed this specific error. – spatra Apr 23 '13 at 04:38

1 Answers1

2

Here is a solved answer to your question -

  1. press button to open web page from app

  2. Open web page inside iOS application

Use a UIWebView which you can add as a subview to any other view, after which call loadRequest on with your URL.

rene
  • 41,474
  • 78
  • 114
  • 152
Vikr
  • 121
  • 1
  • 7