On Nov 7, 2011, at 10:09 AM, Jonathan Taylor wrote:

> I have a window and window controller which in the absence of an object 
> controller work fine, and both are deallocated when the window is closed. If 
> I add an ObjectController to the NIB and bind its "Content Object" to "File's 
> Owner.self" then the window no longer closes properly.

What is the File's Owner?  Is the window controller the file's owner?  Is the 
window controller the one loading the NIB (rather than, say, using NSBundle or 
NSNib directly)?  NSWindowController has some built-in functionality to break 
retain cycles for binding through File's Owner when and only when it is the 
File's Owner and loads the NIB.

What would you sensibly bind to the File's Owner itself, rather than one of its 
properties?  In other words, what is bound to or through the object controller?

> Is there something important that I should be doing here? Should I somehow be 
> releasing the object controller, or indicating to it that it is no longer 
> required?

It shouldn't be required, but, as a last resort, you can set the object 
controller's content to nil in -windowWillClose:.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to