deallocation of related objects
deallocation of related objects
- Subject: deallocation of related objects
- From: Daryn <email@hidden>
- Date: Tue, 11 Mar 2003 19:31:34 -0600
I have an interesting problem for which I'd like implementation
suggestions. In the general sense, I need to be able to be able to
invisibly attach metadata to any existing objc object. When the object
is destroyed, then the metadata needs to be freed.
My current/flawed implementation involves using a NSMap table to
associate the non-retained object with a pointer to its extra data.
However, I cannot find a suitable way to know when the object has been
destroyed so that I may remove the entry in the map table and free the
metadata.
The key to the problem is that I can't subclass the objc objects. The
attachment needs to be transparent. I'd feel really dirty if I had to
twiddle __CFOASafe and use __OARecordAllocationEvent to watch for
__kCFReleaseEvent...
Daryn
_______________________________________________
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.