Opening url from a label or button

Discussion in 'Mac Programming' started by aafuss1, Jul 31, 2008.

  1. aafuss1 macrumors 68000

    aafuss1

    Joined:
    May 5, 2002
    Location:
    Gold Coast, Australia
    #1
    How do I add code for opening a url from a label or button in a xCode project?
     
  2. masonmey macrumors newbie

    Joined:
    Jul 15, 2008
    #2
    I am not sure which part you are having trouble with but here is some code to open a URL.

    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:mad:"http://www.apple.com"]];

    If you need help setting up the event on the button, I would check out this http://cocoadevcentral.com/d/learn_cocoa/. Good luck.
     

Share This Page