Re: WeakCache?
Re: WeakCache?
- Subject: Re: WeakCache?
- From: petite_abeille <email@hidden>
- Date: Mon, 28 Apr 2003 16:56:09 +0200
On Monday, Apr 28, 2003, at 16:26 Europe/Zurich, j o a r wrote:
No, it will not magically do anything to the NSValue you keep. The
value object is just an integer (or something similar) and does not
have any real connection to the live object it points to.
Anyway to check for the validity of what nonretainedObjectValue is
returning?
My suggestion is that you add a method to remove the object from the
cache when it is being removed from the collection, either to the
dealloc method of the object itself, or to the remove method in the
controller.
I see... but if I need to proactively remove an object from a cache in
dealloc, this creates a very unfortunate dependency between the object
and its cache... something I would like to avoid altogether :/ Any idea
about how to implement a generic weak cache mechanism which doesn't
depends on any help from the objects it's holding to stay valid?
Thanks.
Cheers,
PA.
_______________________________________________
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.