• 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
Re: class changes and serialized objects in a nib file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class changes and serialized objects in a nib file


  • Subject: Re: class changes and serialized objects in a nib file
  • From: Chris Hanson <email@hidden>
  • Date: Wed, 30 Nov 2005 10:53:17 -0800

On Nov 30, 2005, at 8:45 AM, A. Blue wrote:

@interface classA : NSWindow
{
	IBOutlet NSWindow *window;
	IBOutlet SlideView *aView;
}

One other thing I forgot to point out. A lot of (non-Cocoa) frameworks encourage you to subclass a Window or Form class as part of "normal" document-based application development, and add the controls in the window and utility windows to that subclass as instance variables.


With most frameworks, including Cocoa, this is actually unnecessary and can lead to a more confusing class hierarchy than necessary. Instead, you generally want to implement some form of controller class whose instances manage both a window and its contents.

In Cocoa this would generally be an NSWindowController subclass. If you're building a document-based application where a document can be represented by multiple open windows, you can even associate multiple window controllers with a single document, one per type of window.

Generally, I would only subclass a framework's Window class if I wanted to create a new kind of window, such as a round window.

  -- Chris

_______________________________________________
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


References: 
 >class changes and serialized objects in a nib file (From: "A. Blue" <email@hidden>)

  • Prev by Date: Re: Warnings that won't go away
  • Next by Date: more than one plist in a file.
  • Previous by thread: Re: class changes and serialized objects in a nib file
  • Next by thread: more than one plist in a file.
  • Index(es):
    • Date
    • Thread