Re: dealloc and Instances created from IB
Re: dealloc and Instances created from IB
- Subject: Re: dealloc and Instances created from IB
- From: Matt Thomas <email@hidden>
- Date: Wed, 13 Mar 2002 18:03:08 -0500
I created a class in Interface Builder, instantiated it, made the
proper connections, and then created the files. I then edited the
class and added init and dealloc methods in the class. I was then
debugging the class and it looks like dealloc was not being called.
When are you expecting it to be called, and why?
So my questions is, if i have an instance of a class created in
Interface Builder, will it's dealloc method ever be called? Is there a
method I can use to make sure clean up goes okay when I release an
object?
Probably the easiest approach is to ensure your NIB controller is
subclassed from NSWindowControler -- it should ensure that all of the
objects in the UI get released properly (see
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
MemoryMgmt/index.html
)
mmalc
I had thought it would have been called when the application ended since
it was instantiated when the nib was loaded. I just wanted to make sure
that everything gets released properly when the application quits.
That link cleared some things up though. Thanks.
-Matt
_______________________________________________
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.