• 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: question about forward declarations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about forward declarations


  • Subject: Re: question about forward declarations
  • From: "Erik M. Buck" <email@hidden>
  • Date: Tue, 7 Aug 2001 14:14:43 -0500

First, your class names should start with a capital letter an a unique
prefix.
Second, try this:
////////////////////////////////////////////////////////////////////////////
///////////
//MYLauncher.h
#import <AppKit/AppKit.h>

@class MYMissile;

@interface MYLauncher : NSObject
{
MYMissile *_myMissile; // instance variables should
start with a lower case unique prefix
// and if they
are not public they shouls start with an _ IMHO
}

@end


////////////////////////////////////////////////////////////////////////////
///////////
//MYMissile.h
#import <AppKit/AppKit.h>

@class MYHuman;

@interface MYLauncher : NSObject
{
MYHuman *_myHuman; // instance variables should start
with a lower case unique prefix
// and if they
are not public they shouls start with an _ IMHO
}

@end


////////////////////////////////////////////////////////////////////////////
///////////
//MYHuman.h
#import "MYLauncher .h"


@interface MYHumanLauncher : MYLauncher // Classes should include
superclass name IMHO

// e.g. NSView, NSTextView
{
MYMissile *_myAnotherMissile; // MYHumanLauncher already
inherited _myMissile from
//
MYLauncher . Perhapse you want an array of missiles
// in
the MYLauncher class ?
}

@end

Subclasses must import the interface of their super class so that the
compiler knows how much memory to reserve and what instance variables are
available.


----- Original Message -----

  • Prev by Date: Re: NSProgressIndicator and other controls in a cell in an NSTableView
  • Next by Date: Re: Admin programs and password
  • Previous by thread: Re: NSProgressIndicator and other controls in a cell in an NSTableView
  • Next by thread: problems with glyph y-axis flipping in an NSBezierPath
  • Index(es):
    • Date
    • Thread