 |
 |
Send URL to browser from Cocoa app
|
 |
|
 |
|
jonasw
|
|
I'm looking for a way to send a http/https URL to a browser from inside a Cocoa app. What I need is something similar to ICLaunchURL() in Carbon which picks a browser from the user's Internet preferences.
I've tried saving the URL to a somename.url file and then opening it using the default app for the .url extension but it fails since [[NSWorkspace sharedWorkspace] openFile:...] doesn't seem to interact well with non-Cocoa applications (Internet Explorer in my case). The NSURL* foundation classes won't help either from what I can tell. Am I supposed to use the Internet Config API from Cocoa as well?
Thanks in advance!
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
I would suggest poring through the source to Fire.app over at http://www.epicware.com. I haven't looked through it myself, so I don't know how he handles it, but the help menu in Fire has an item that contacts his page.
|
|
|
| |
|
|
|
 |
|
 |
|
jonasw
|
|
Excellent! Using ICLaunchURL() from Cocoa was the solution. However, I'm puzzled about mixing Cocoa and Carbon APIs in the same application -- this time it worked, but I'd be surprised if it's generally supported. I mean, I don't expect TextEdit fields to work in NSViews, or the Carbon Drag Manager DragRefs be used interchangeably with NSDragging etc. Unfortunately, Apple's documentation is lacking in this regard.
[This message has been edited by jonasw (edited 01-02-2001).]
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Perhaps Apple implemented it under Cocoa for lack of a better name or something... Carbon API calls don't work from Cocoa.
Apple's Cocoa documentation is generally lacking, there's a lot of it that hasn't been written yet. I hope they fix that soon.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Oct 1999
Status:
Offline
|
|
You can indeed use Carbon functions in Cocoa apps, just link to Carbon, initialize toolbox, convert data structures, call functions. It's just another lib, mix and match with glee!
Carbon is also a dyld lib so in theory it won't use more memory than otherwise, only loading those modules your app calls.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Really? That's pretty cool :-)
Oh well, my bad.
*** Angus D slinks away into a corner.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|