Re: Subclassing NSTextView - dealloc never gets called and program crashes
Re: Subclassing NSTextView - dealloc never gets called and program crashes
- Subject: Re: Subclassing NSTextView - dealloc never gets called and program crashes
- From: j o a r <email@hidden>
- Date: Sun, 18 Jul 2004 19:04:51 +0200
Never - ever - send dealloc to an object. The method you should send to
balance the implicit retain the object received when you allocated it
is "release".
Re-read the available documentation of memory management in ObjC+Cocoa!
j o a r
On 2004-07-18, at 18.53, <email@hidden> wrote:
>
The problem is that when the dealloc method for my NSWindowController
>
subclass gets called I send the dealloc message for each NSTextView
>
subclass instance variable as for example:
>
>
- (void) dealloc
>
{
>
[text1 dealloc];
>
[text2 dealloc];
>
...
>
}
>
>
But the dealloc method for text1 and text2 NEVER gets called and my
>
application crashes right after the [text1 dealloc] line.
>
>
When I debug the application and the debug tries to execute the line
>
>
[text1 dealloc]
>
>
it is as if it can't access text1 (either it does not exist anymore or
>
its access is not allowed) and the debugger show assembler code which
>
I don't understand.
>
>
I have put the line below in my NSTextView class dealloc method but it
>
is never displayed:
>
NSLog(@"I am at my NSTextView subclass dealloc method");
>
>
Why is this happening? Is there a workaround?
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.