when i refer to a file, i used:

file = [[NSMutableDictionary alloc] initWithContentsOfFile:[Folder stringByAppendingPathComponent: FileName]];

Folder is set up as:
Folder = [[NSString alloc] initWithString:[@"path" stringByExpandingTildeInPath]];

and Filename is:
FileName    = [[NSMutableString alloc] initWithString:@"filename.txt"];


perhaps that may help.

jack


On Aug 4, 2008, at Mon-08 /04 /08-12:43 AM, Patrick Walker wrote:

It seems that whenever I use Xcode to spawn the program, it is able to find the file but when spawning the program from Finder, it can never, ever find the file. I've been looking online and no one seems to have come across this before or maybe it's because it's so late that I'm not seeing the obvious.

NSString *fileContents = [[NSString alloc] initWithContentsOfFile: [filename stringValue] encoding:NSASCIIStringEncoding
                                                        error:nil];
Filename is an NSTextField outlet, btw.

We've tried all sorts of things to try and find the file, File.txt, ./File.txt, ~/File.txt, "./File.txt". I can understand maybe the ~ doesn't work for all shells but explicitly using ./File.txt should be opening the file in the current directory with the executable, shouldn't it? Do I *really* have to append a huge long path each time I want to open a file?

Any ideas? It says path and the documentation says that it has to be NSString. I've used filepaths before for open() but those are C strings and those are full paths though, i.e., /dev/stdout. It's such a simple problem what am I missing here?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/intrntmn%40aol.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to