Re: NSString and txt file
Re: NSString and txt file
- Subject: Re: NSString and txt file
- From: Bill Houston <email@hidden>
- Date: Wed, 14 Apr 2004 16:00:06 -0700
Martha,
My use is slightly different, but the principle should be the same. Here is
my code:
// set the file path
NSString *eulaFilePath = [ LegalBundle pathForResource:kLicenseName
ofType:kLicenseExtension inDirectory:nil forLocalization:localization];
/ read the data into a data object
NSData *eulaData = [NSData dataWithContentsOfFile:eulaFilePath];
// transfer the data object to an NSString
eulaString = [[NSAttributedString alloc] initWithHTML:eulaData
baseURL:nil documentAttributes:nil];
Hope it helps,
Bill
On 4/14/04 2:57 PM, "email@hidden"
<email@hidden> wrote:
>
Message: 1
>
Date: Wed, 14 Apr 2004 14:44:14 -0600
>
To: email@hidden
>
From: Martha Espinosa <email@hidden>
>
Subject: NSString and txt file
>
>
Hi,
>
>
I am trying to read in .txt file from a mounted drive so I have tried
>
the following...
>
>
using applescript I mount a network share then copied my
>
SWinstallers.txt file to the /tmp directory and in my AppController.m
>
I added the following
>
>
NSString *path = [NSString stringWithFormat:@"/tmp/SWinstallers.txt",
>
NSHomeDirectory()];
>
OR
>
NSString *path = [NSString
>
stringWithFormat:@"%@/tmp/SWinstallers.txt", NSHomeDirectory()];
>
>
When my table comes up it displays nothing....
>
>
another way I tried was in my AppController.m
>
>
NSString *path = [NSString
>
stringWithFormat:@"/Volumes/Production/SWinstallers.txt",
>
NSHomeDirectory()];
>
OR
>
NSString *path = [NSString
>
stringWithFormat:@"%@/Volumes/Production/SWinstallers.txt",
>
NSHomeDirectory()];
>
>
>
can anyone point out what am I doing wrong??
_______________________________________________
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.