Re: Retain cycles with NIB instantiations, bindings
Re: Retain cycles with NIB instantiations, bindings
- Subject: Re: Retain cycles with NIB instantiations, bindings
- From: Ken Thomases <email@hidden>
- Date: Sun, 12 Jul 2009 03:40:06 -0500
On Jul 10, 2009, at 2:19 AM, Half Activist wrote:
I'm loading a NIB file at runtime and use a new instance of a class
as its owner each time.
Everything works fine, until I wish to delete an object.
In my software, i'm using several instances of objects that have
their own UI but are all part of kind of "project", a controller/
manager entity.
So each time I create a new "backend" object, I tie an UI to it,
loaded with a NIB file and use bindings to the object to handle UI
updates.
Now when I delete the object from my controller, it doesn't get
dealloc'd since the bindings in the NIB retain it.
Do you know of a way to proceed other than creating a notification/
callback trigerred at the deletion of the object from the "manager"
that would destroy the UI and therefore break this retain loop?
The File's Owner for nibs which contains windows or views should be
derived from NSWindowController or NSViewController. Those classes
have mechanism to break the retain cycles.
Regards,
Ken
_______________________________________________
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