Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

KoolStar

macrumors demi-god
Original poster
Oct 16, 2006
825
9
Kentucky
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.
 

RossOliver

macrumors regular
Nov 6, 2006
157
0
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.

Code:
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:
@"http://www.google.co.uk"]];

-Ross
 

intelliot

macrumors member
Jul 18, 2006
95
1
What's the difference between [NSWorkspace sharedWorkspace] and [UIApplication sharedApplication] ?
 

dancavallaro

macrumors regular
Jul 13, 2008
148
0
What's the difference between [NSWorkspace sharedWorkspace] and [UIApplication sharedApplication] ?

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"]];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.