Re: dealloc not beeing called... why?
Re: dealloc not beeing called... why?
- Subject: Re: dealloc not beeing called... why?
- From: Ondra Cada <email@hidden>
- Date: Mon, 8 Jul 2002 14:38:01 +0200
On Monday, July 8, 2002, at 09:33 , Development wrote:
I didn't find anything about this topic in the docs, so maybe someone
here can point me to an answer.
Well, the answer is that dealloc gets called when the object is freed.
I create a new project in PB ("Cocoa Application", not document-based,
because I need to have just one main window). After subclassing NSObject
in IB, I add two functions to the new class:
...
- (void)dealloc{
NSLog(@"Called dealloc");
[super dealloc];
}
Presumed you not only subclased the object in IB, but instantiated it
there too, and use it as an application controller, right? There is thus
no outlet to this instance anywhere; it gets created when the NIB is
loaded, and exists till application quits, right?
Well, if so... since you don't ever free the object, its dealloc doesn't
get called. It's that simple.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.