• 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
Unclear on -makeWindowControllers in doc-based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unclear on -makeWindowControllers in doc-based app


  • Subject: Unclear on -makeWindowControllers in doc-based app
  • From: Andrew Merenbach <email@hidden>
  • Date: Sun, 11 Dec 2005 11:05:32 -0800

Hi, all. I've looked in the docs with regard to (what I believe to be) relevant classes and paradigms, and this doesn't seem to be covered at all--because I must have misunderstood, I suspect, something about the whole paradigm involved with separating MVC in document-based apps.

If one has a document-based application and has overridden - makeWindowControllers, so as to put the window controller functionality in one class and the document functionality in another, how does one release the created window controller? As an example, my -makeWindowControllers method now looks like this:

- (void)makeWindowControllers {
NPWindowController *windowController = [[NPWindowController allocWithZone:[self zone]] initWithWindowNibName:[self windowNibName]];
[self addWindowController:windowController];
[windowController release];
}

This works fine, and with no instance variables needed, to boot (in terms of basic functionality) But what about this, from the NSDocument class documentation?

'If you create window controllers in makeWindowControllers or in any other context, such as in response to a user event, you should invoke this method [-addWindowController:] for each created window controller. To remove a window controller from the list of active controllers, send it NSWindowController’s close message.'

Would it be better for me to have an instance variable for the window controller, and then send it a -close message from the -dealloc method of my NSDocument subclass?

Many thanks,
Andrew

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Unclear on -makeWindowControllers in doc-based app
      • From: John Pannell <email@hidden>
  • Prev by Date: Re: Setters, Getters and efficiency
  • Next by Date: troubles with a progress bar updating
  • Previous by thread: Re: Core Data: How do I populate detail entities (tables) programmatically?
  • Next by thread: Re: Unclear on -makeWindowControllers in doc-based app
  • Index(es):
    • Date
    • Thread