File Question
File Question
- Subject: File Question
- From: Nick <email@hidden>
- Date: Tue, 1 Jan 2002 23:37:30 +0700
My sincerest apologies for bothering the list with another file
question, but I am unable to find a solution in the documentation
anywhere, although I am sure there is something I am overlooking.
I am currently getting the two following errors in different situations:
1. The program launches, (in awakeFromNib:) looks for a certain file
and finds it does not exist. The program then creates the file, and
then writes 365 sets of data to the file. This involves both seek and
write operations.
The error received later in the program (upon the user's request) when
trying to seekToFileOffset before reading in data is that a
NSCFDictionary does not respond to the selector seekToFileOffset. I do
not know why a NSCFDictionary is brought up at all, as the message is
sent to an NSFileHandle. Also, as the program had no problem seeking
using this method earlier in the program (setting up the file and
writing data), I see no reason for this error.
(I wonder if this could be possible because of the FileHandle being
released before I try to use it the second time?)
2. The program launches, looks for a certain file and finds it (because
it was created in situation 1 above). Later in the program (upon the
user's request), my instance of NSFileHandle is asked to seek to a
certain position and gives the following error:
End of archive encountered prematurely at 74
I'm not sure if 74 is the number of bytes into the file or what exactly
it represents but I am unsure why it would suddenly end as the file I've
created previously is much longer than the certain data I am trying to
access with this function. Does this error generally mean that the file
ended prematurely or that a certain encoded NSData ended prematurely?
Any help at all would be most appreciated. Speedy help would be even
more appreciated as the project that this is necessary for is due this
Saturday. If more information is needed, please ask: email@hidden.
Thanks,
Nick
email@hidden
_______________________________________________
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.