• 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
NSWindowController Subclassing - windowDidLoad Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWindowController Subclassing - windowDidLoad Method


  • Subject: NSWindowController Subclassing - windowDidLoad Method
  • From: Nelson Santos <email@hidden>
  • Date: Sun, 30 Apr 2006 03:14:16 -0700

Hi all,

I am stuck. I am building a Cocoa document-based application. I have decided to separate my model-controller and view-controller into two classes. A subclass of NSDocument is acting as the model- controller and a subclass of NSWindowController is acting as the view- controller.

In my document nib file, I have several controls including an NSButton and an NSFieldText. What I'd like to do is set the enabled/ disabled status of the button and the text value of the text field to certain values before the window/nib is displayed to the user. I tried doing this in NSWindowController's windowDidLoad method, but it didn't work. The problem is that none of the controls have been instantiated yet when this method was called. Another option is to do it in the NSDocument's windowControllerDidLoadNib method which I'm sure will work, but I don't want to put the code in there because I feel that it is a view-controller related thing and belongs in my NSWindowController subclass.

What are my other options? Am I using the best approach? Should I just lump all controller related code into NSDocument subclass and be done with it? I know that splitting the controller logic is a viable design decision, but I can't figure out how to handle this situation.

Thanks to all who respond!

Nelson

_______________________________________________
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: NSWindowController Subclassing - windowDidLoad Method
      • From: Mike Abdullah <email@hidden>
References: 
 >Re: Distributed objects: Code required on both sides? (From: Philippe Mougin <email@hidden>)

  • Prev by Date: Re: Distributed objects: Code required on both sides?
  • Next by Date: NSOpenPanel setCanChooseDirectories behavior
  • Previous by thread: Re: Distributed objects: Code required on both sides?
  • Next by thread: Re: NSWindowController Subclassing - windowDidLoad Method
  • Index(es):
    • Date
    • Thread