> On 8 Sep 2015, at 22:40, David Durkee <da...@dwdurkee.com> wrote: > > I have a document-based application where the documents have a second window, > which is used for editing a color list for the document. Originally I just > conceived this as a modeless dialog, but recently I wanted to make the > document able to handle the Undo command when this window has focus. To do > this, I make it a second document window by calling the document’s > addWindowController method. > > This had the side effect of the document not closing or trying to save until > both the main document window and the color list window were closed by the > user. The color list window is still a secondary window, so I want to treat > closing of the main window as a request to close the document. The first > thing I tried was adding a windowWillClose window delegate method to the > document for the main window, and inside that method, close the secondary > window. > > Unfortunately I discovered that, if both windows are open, closing the main > one now closes both without trying to save the document, resulting in data > loss. > > I haven’t been able to find a way to make trying to close the main window try > to close the document even if the secondary window is open.
Sounds to me like you want to set .shouldCloseDocument on one of your window controllers. _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com