Re: NSArrayController - Remove and immediately deallocate objects
Re: NSArrayController - Remove and immediately deallocate objects
- Subject: Re: NSArrayController - Remove and immediately deallocate objects
- From: Jens Alfke <email@hidden>
- Date: Mon, 03 Feb 2014 12:03:31 -0800
On Feb 3, 2014, at 11:49 AM, Leonardo <email@hidden> wrote:
> I need to quickly deallocate the objects because they will freed up other
> objects. If these latest objects don't get deallocated they receive some
> message when they should not. So I really need to deallocate the objects in
> the right order.
This sounds like a design problem in your object model. If the objects shouldn't be receiving another message, then they should unregister from it somehow.
In other words, instead of triggering the cleanup when the objects are dealloced, they may need an explicit call like -cleanUp or -close or something. Then you can call that on them when they're removed, and they can do the cleanup immediately even if the actual dealloc isn't immediate.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden