Re: Memory Error -NSRTFReader?
Re: Memory Error -NSRTFReader?
- Subject: Re: Memory Error -NSRTFReader?
- From: David Remahl <email@hidden>
- Date: Wed, 28 Nov 2001 16:20:49 +0100
>
Hi all,
>
>
I am learning Cocoa and trying to create a simple game and I have run into a
>
problem I can't seem to solve. I think I have a general understanding as to
>
how memory management works in Cocoa, but if this doesn't make any sense
>
then let me know.
This does not make sense! And I mean that in the kindest sense...
>
My app keeps dying with a "EXC_BAD_ACCESS" error in the debugger. When I
>
step through the code the error occurs at this line:
>
>
[NSRTFReader dealloc]
You shall (hardly) ever call dealloc directly! You should use the retain and
release mechanism. What is most definitely happening, is that some other
object (probably a part of cocoa) is still using the NSRTFReader object when
you release it.
There is an excellent article on StepWise on the topic of basic mem
management.
/ david remahl