swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Class variables not inherited?


From: Paul Johnson
Subject: Class variables not inherited?
Date: Wed, 24 May 2000 15:38:37 -0500

When a class variable is declared in a the "m" file, before the
implementation line, it works fine.  In order to have that variable be
inherited by a subclass, what kind of declaration do I need in the "h"
file.  I know its not extern. In case this is unclear, here is a bit of
code

Agent.m:

#import "Agent.h"

World * worldForAgent;

@implementation Agent

+setWorld: (World *)aWorld;
{
  worldForAgent = aWorld;
  return self;
}

Works fine, but subclasses from Agent don't inherit the variable
worldForAgent.

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]