FROM : neuroboy
DATE : Fri Jan 10 20:55:24 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Fri Jan 10 20:55:24 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

