On 13 Sep 2014, at 00:11, Luc Van Bogaert <luc.van.boga...@me.com> wrote:
> >> Op 12 Sep 2014 om 23:40 heeft Quincey Morris >> <quinceymor...@rivergatesoftware.com> het volgende geschreven: >> >>> On Sep 12, 2014, at 13:57 , Luc Van Bogaert <luc.van.boga...@me.com> wrote: >>> >>> When I try to close the inspector panel in my document base application, >>> I'm getting the default alert message to save the document if it has >>> unsaved edits. Is there a way to disable this behaviour when closing an >>> inspector panel? >> >> Set ‘shouldCloseDocument’ to NO on the panel. >> >> However, the question implies that you’ve set the panel’s window >> controller’s “document” property to your document. I’d be concerned that >> this might lead to other hinky behavior, since AFAIK the property is >> intended for window controllers that really belong to the document. Is the >> panel also in the document’s “windowControllers” array? >> >> OTOH, I dunno really. Maybe setting the panel’s controller’s “document” >> property is a *good* thing, and I’m just too risk-averse to have ever >> experimented with it. >> > > Your assumption about the document property is correct (it seemed to work > fine up until now) and my panel controller is not in the document > windowcontrollers array. I guess that is what is causing my problem, so I > think I'll have to redo that part. > Thanks! I've been able to solve my initial problem (and delete a lot of code) by adding the panel controller to the document's array of window controllers. But now I have another problem: when I load the panel for the first time, it's controller is added to the document's array of windowcontrollers in 'windowDidLoad'. After this, the panel correctly display's the document's properties using bindings. But when I close the panel and reopen it again, it seems that the panel has lost a reference to the document and it doesn't display the document's properties anymore. Any advice on how I could solve this? Thank you, -- Luc Van Bogaert
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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