Creating A Link To A WebPage

Discussion in 'iOS Programming' started by KoolStar, Aug 13, 2008.

  1. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #1
    I know this may sound like a dumb question. I have and application complete except for the about. The about link, I'm completely dumbfounded on how to create a link to a webpage from a button. A.K.A. A button that when clicked will open a page in safari.
     
  2. RossOliver macrumors regular

    Joined:
    Nov 6, 2006
    #2
    Code:
    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:
    @"http://www.google.co.uk"]];
    
    -Ross
     
  3. KoolStar thread starter macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #3
    Thank you very much. I knew was something so simple.
     
  4. intelliot macrumors member

    Joined:
    Jul 18, 2006
    #4
    What's the difference between [NSWorkspace sharedWorkspace] and [UIApplication sharedApplication] ?
     
  5. dancavallaro macrumors regular

    Joined:
    Jul 13, 2008
    #5
    As far as I can tell, NSWorkspace doesn't exist on the iPhone. What you want is basically what RossOliver said, but with UIApplication instead of NSWorkspace:

    Code:
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:
    @"http://www.google.co.uk"]];
    
     
  6. intelliot macrumors member

    Joined:
    Jul 18, 2006

Share This Page