RE: Beginners question regarding NSFileHandle
RE: Beginners question regarding NSFileHandle
- Subject: RE: Beginners question regarding NSFileHandle
- From: "Adam Knight" <email@hidden>
- Date: Mon, 6 Aug 2001 15:41:11 -0500
Completely wild guess:
NSFileHandle fh;
fh = [[NSFileHandle alloc] init];
blah blah blah
I'm at work in Windows, but the last time I had that problem with an object it
was because this Perl hacker forgot that C objects need to be explititly
allocated and initialized and you cannot release what you do not have. =)
--
____________________________________________________________________________
Adam Knight
______________________________Codito, ergo sum______________________________
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Roger Gilliar
>
Sent: Monday, August 06, 2001 2:14 PM
>
To: email@hidden
>
Subject: Beginners question regarding NSFileHandle
>
>
>
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. Why
>
?
>
>
BTW: Is it possible to use the NSFileHandle type for fh instead of the
>
generic id type ?
>
>
Regards
>
Roger
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev