Re: Append to file with NSString writeToFile:
Re: Append to file with NSString writeToFile:
- Subject: Re: Append to file with NSString writeToFile:
- From: Harilaos Skiadas <email@hidden>
- Date: Mon, 28 Feb 2005 06:54:50 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
>Actually, I think I figured out what my problem is.
All my code looks
>fine, but I was reading the docs on NSFileHandle and
it says in the
>fileHandleForWritingAtPath: method that if no file
exists at path, it
>returns nil. I believe this is what is happening.
In the save panel where
>the user is choosing where to save they file, they
are provided with a
>default filename. But when they click OK, the file
technically does
>not exist.
>
>So now the question is, how do I create a file to
write to? Will keep
>looking through the docs. Thanks.
>
>James
In that case, what you need is probably NSFileManager
and its methods. Lots of goodies there!
Btw, the code you posted earlier was leaking in a
major way. You inited a fingerprint string, and then
set fingerprint=[[fingerprint
stringByAppendingString...]]
This created a new, autoreleased object, and made
fingerprint point to it, but you lost the reference to
the original object you created, which you had not
autoreleased yet.
Haris
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden