How can I close a document that has no window?
How can I close a document that has no window?
- Subject: How can I close a document that has no window?
- From: email@hidden
- Date: Fri, 10 Jan 2003 14:55:24 -0500
- Priority: normal
Hi,
I have a document based app that loads docs in tabs rather than windows. I have a subclass of NSWindowController manage the tabs. I am confused from reading the documentation just how I should go about closing my document. Right now I:
1) have the TabView call a method on the controller subclass that invokes the canCloseWindowCOntroller:withDelegate: ... method in my document subclass. The callback is in the window controller and calls the window controller's close method
2) this just uses super's method and so calls the canCloseDocument:withDelegate:selector ... method which sees that the doc is closeable and calls the document's close method. I to set the controller's doc to nil here or I get a bad access crash.
3) this method actually seems to call t he window controller's close method which deallocs the doc apparently then closes itself.
It works, but I feel like I've created a mess. Have I?
John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.