Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Opening URL?

Opening URL?
Thread Tools
zachs
Mac Elite
Join Date: May 2002
Location: New York City
Status: Offline
Reply With Quote
Feb 2, 2003, 04:21 AM
 
Does anyone know how to launch a
URL in Cocoa?

I have:

- (IBAction)goApple:(id)sender
{
[NSWorkspace sharedWorkspace];
openURL:[NSURL URLWithString:@"http://apple.com/"];
}
Thoughts?
:hmm:
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 2, 2003, 05:12 AM
 
Yeah, that would pretty much be how you do it....
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Feb 2, 2003, 08:35 AM
 
Code:
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.apple.com"]];
The code you posted won't compile because of syntax errors.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:01 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,