Re: Filename
Re: Filename
- Subject: Re: Filename
- From: Alex Rice <email@hidden>
- Date: Wed, 20 Mar 2002 21:38:57 -0700
On Wednesday, March 20, 2002, at 02:49 PM, Jason Reece wrote:
Please help.
I am a beginner programmer in Cocoa and Objective C.
I need to get the path and filename of a file that I've opened so I can
process it. I'm porting an existing app. which needs it.
Currently my Cocoa bit works fine in opening the file and displaying it
(using NSTextView and an associated NIB file), but how do I get the
filename and path?
I am guessing you are using an NSDocument based Cocoa project? If so,
then you can just do in your NSDocument class:
NSString *myFileName = [self fileName];
NSString has a bunch of methods for twiddling with pathnames and
filenames, and there is also NSURL.
If this isn't helpful, maybe you can describe more about your app- how
have you managed to already load the file into an NSTextView without
knowing the filename?
Alex Rice <email@hidden>
Mindlube Software
http://www.mindlube.com/
_______________________________________________
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.
References: | |
| >Filename (From: Jason Reece <email@hidden>) |