Re: Get default Browser and Mail Client
Re: Get default Browser and Mail Client
- Subject: Re: Get default Browser and Mail Client
- From: Ondra Cada <email@hidden>
- Date: Tue, 17 Sep 2002 16:24:24 +0200
On Tuesday, September 17, 2002, at 03:08 , David Remahl wrote:
By the way is there a cleaner way than regex to extract the name of the
app from the URL I get: I receive /Applications/Internet/Navigator.app
and I want "Navigator".
Hmmmm... would
[[path lastPathComponent] stringByDeletingPathExtension]
be sufficient?
Apple's recommended way is to use
[[NSFileManager defaultManager] displayNameAtPath:path];
This will show the file name extension on files where it should, and hide
it
on those where it should. It will also show localized names whene
available.
I am sorry, but that is not an answer to the concrete question, ie. 'I
receive /Applications/Internet/Navigator.app and I want "Navigator"'. The
solution you outlined -- unquestionably better eg. for displaying the app
name, of course! -- might easily return even something like "Pryzkumnmk"
or even worse ;)
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.