Check if URL Handler is available for URL
Check if URL Handler is available for URL
- Subject: Check if URL Handler is available for URL
- From: Manfred Lippert <email@hidden>
- Date: Wed, 18 Sep 2002 16:46:39 +0200
Hi,
I need a routine that checks for any string if it is
- a valid URL
and
- if there is a service (handler) registered in the system for this URL
I should _not_ check if the resource to which the URL references does
exist. All should work local and fast.
How can I do that?
The routine should e.g. return TRUE for the following strings:
"
http://blah.com"
"webcal://jdfhgkjg"
"
mailto:email@hidden"
and any other available services that may be available in the future.
But it should return FALSE for the following strings:
"doesnotexist://domain.com"
"invalidurl"
(If there is no handler for "doesnotexist:" registered in the system
;-))
I tried the following, but it does not work:
NSString myString = ...
BOOL isURLAndServiceIsAvailable =
([NSURLHandle URLHandleClassForURL:[NSURL URLWithString:myString]] !=
nil);
It would have been very cool if that had worked, but it doesn't. :-(
For simple URLs like "
http://domain.com" is works, but e.g. not for
"webcal://domain.com" or "
mailto:email@hidden" etc.
Do I have to use InternetConfig?
BTW: webcal-URLs do work on my computer, but there no "webcal" service
listed in the "More Internet" Preference Panel - why?
(More Internet is available at
http://www.monkeyfood.com/software/)
Thank you for any help,
Mani
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.