Re: Odd stuff with Cocoa-Java
Re: Odd stuff with Cocoa-Java
- Subject: Re: Odd stuff with Cocoa-Java
- From: Andreas Monitzer <email@hidden>
- Date: Mon, 1 Oct 2001 09:01:12 +0200
On Monday, October 1, 2001, at 12:32 , Brian Hook wrote:
At 11:59 PM 9/30/01 +0200, Andreas Monitzer wrote:
You don't have to, take a look at formatters. Subclassing is very seldom
in Cocoa.
Subclassing in general, or subclassing text views? Because if you're
saying the former, then I'm doing something REALLY wrong because I'm
subclassing the hell out of NSWindowController and NSView right now.
NSWindowController:
For simple documents-that is, documents with only one nib file containing
a window-you need do little directly with NSWindowController. The
Application Kit will create one for you. However, if the default window
controller is not sufficient, you can create a custom subclass of
NSWindowController.
NSView:
NSView is an abstract class that defines the basic drawing, event-handling,
and printing architecture of an application. You typically don't interact
with NSView API directly; rather, your custom view classes inherit from
NSView and override many of its methods, which are invoked automatically
by the Application Kit.
So they were designed for being subclassed. All window controls (NSButton,
NSTextField etc) and utility classes (NSString, NSDicionary etc) were NOT
designed for that.
In PowerPlant, you have to subclass everything if you want it to do
something (no actions/outlets), and it was a real pain for me.
andy
--
God created the universe in 6 days because He didn't have to worry about
an installed base.