Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do I remove the extension from a path?



Alan,

On 30.4.2006, at 16:21, Alan Smith wrote:

I have a app that loads the files from a directory. It works fine but I
don't want the path to have the extension on the end. Some of the files are
'.rtf' and the others are '.txt' Right now it goes through a loop and puts
all the file names in an array that is put in a table. How do I get rid of
the extension so the user doesn't see it?

Although you can always use stringByDeletingPathExtension, I would argue the user well may *want to* see the extension (I would, for one), and thus you should use displayNameAtPath: of NSFileManager, which takes into account the appropriate Finder preset (and concrete file metadata, if any).
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >how do I remove the extension from a path? (From: "Alan Smith" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.