binding not removed before view dealloc

67 views Asked by At

In my NSDocument-based app, my document subclass creates and retains a "parameters" property during init and of course releases it during dealloc. This object is a collection of document properties and settings.

I have a DocumentWindowController that has a toolbar attached. One of the toolbar items is a segment control that controls the view style. This control's selected tag is bound in the nib to:

self.document.parameters.itemsViewStyle

The problem is that when I close my document, my DocumentWindowController gets deallocated, followed by my Document, which deallocates its DocumentParameters object.

An instance 0x6080000e4a80 of class DocumentParameters was deallocated while
key value observers were still registered with it. Current observation info:
<NSKeyValueObservationInfo 0x610000050dd0> (<NSKeyValueObservance
0x6080000cc6a0: Observer: 0x6080000cc630, Key path: itemsViewStyle, Options:
<New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x61800004a080>

It seems like the DocumentWindowController's toolbar should be breaking the binding to DocumentParameters, but it is not doing so.

What is going on here?

0

There are 0 answers