Re: Beginners question regarding NSFileHandle
Re: Beginners question regarding NSFileHandle
- Subject: Re: Beginners question regarding NSFileHandle
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 6 Aug 2001 15:40:19 -0700
On Monday, August 6, 2001, at 12:13 PM, Roger Gilliar wrote:
I have the following code, that causes a signal 10 (SIGBUS) error:
{
id fh;
fh = [NSFileHandle fileHandleForReadingAtPath:@"/private/tmp/test"];
if (fh == nil) {
// do something
}
else {
[fh readDataOfLength:3];
[fh closeFile];
[fh release];
};
}
As soon as I leave '[fh release]' in the code I get the signal 10 error.
YOu didn't have to release it.
Convenience methods like +stringWithFormat:, +arrayWithObjects:, and the
like return autoreleased objects by convention.
-jcr
"These kids today don't know the simple joy of saving four bytes of
page-0 memory on a 6502" - unknown