[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: probably trivial problem
From: |
Scott Christley |
Subject: |
Re: probably trivial problem |
Date: |
Thu, 24 Apr 1997 18:59:51 -0700 |
At 05:16 PM 4/24/97 -0700, Peter Deadman wrote:
>OK..this is probably trivial, but I'm not sure whats going on.
>
>I create a group of agents in modelSwarm and put them
>in a list called agentList. When I compile the program, I get this
>warning message:
>
>CprModelSwarm.m: In function `_i_CprModelSwarm__buildObjects':
>CprModelSwarm.m:110: warning: local declaration of `agentList' hides
instance variable
>CprModelSwarm.m:130: warning: local declaration of `agentList' hides
instance variable
This means that you've declared a local variable which has the same name as
an instance variable (either of that class or one of its super classes).
GCC allows this, but what happens is that you cannot get access to the
instance variable within the scope of that local variable; that is what the
warning means when it says "hides". The easy fix is to rename the local
variable to something else like 'anAgentList'
Scott
==================================
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.
==================================