• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I close a document that has no window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Best beginner's book
  • Next by Date: Re: Real dumb question...
  • Previous by thread: Re: NSMovie/NSMovieView problem
  • Next by thread: Re: Validating Input from Sheet
  • Index(es):
    • Date
    • Thread