Re: [Pyobjc-dev] Cocoa/Objective-C equiv to __del__?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-08-29 13:44:57
|
On Friday, 29 August 2003, at 15:07, Zachery Bir wrote: > On Tuesday, August 19, 2003, at 02:02 PM, Zachery Bir wrote: > >> Thanks, yeah, looks like the example apps use __del__ (with comments >> that say: "dealloc in Obj-C" :) > > Hmm... Okay, I've got a __del__ method in my application's delegate > class, and I'm trying to clean up after myself. It doesn't seem to get > called, though. I've put an 'import pdb;pdb.set_trace()' in the > __del__ method, and I never get the prompt - it works just about > everywhere else, when I need that kind of run-time introspection. I don't know if the application's delegate is ever cleaned up unless you do so yourself. That might explain why your __del__ method isn't called. > > Question: Is it problematic (or even bad programming/design) to have > the same class as the delegate for the Application, the Window, and an > NSTableView? I can imagine that it might be a bit overloaded, but it > does seem to do stuff for each of those in its way. I'm not sure how I > could share all this information between several delegate classes, but > this has been a bit of an accretive project ;) The real Cocoa guru's probably live somewhere else, but for what it's worth: I also do this is simple programs. Keeping the controllers/delegates for a window together keeps things simple. Ronald |