swarm-support
[Top][All Lists]
Advanced

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

ObjC question about scope of methodes


From: Gadi Oron
Subject: ObjC question about scope of methodes
Date: Mon, 14 Feb 2000 18:23:38 +0100

Hello again,

I have a question that is bothering me,

I defined an object class named "Double" in order to have numbers in a
list
(thanx Marcus G. Daniels). It goes like this:

--- Double.h ------
#import <defobj/Create.h> // CreateDrop

@interface Double: CreateDrop
{
@private
  double value;
}
- setValue: (double)value;
- (double)getValue;
@end


--- Double.m ------
#import "Double.h"

@implementation Double
- setValue: (double)theValue
{
  value = theValue;
  return self;
}

- (double)getValue
{
  return value;
}

@end
----------------
It is implemented in the code as following

#define DOUBLE(value) \
  [[[Double createBegin: globalZone] setDouble: value] createEnd]
....
  li = [List create: self];
  for(i=0; i<size; i++)
    [li addLast: DOUBLE(0)];
----------------

The problem is that I get from the compile (gcc, Linux) the wranings

StatsSwarm.m: In function `-[SwarmStatistics setRhoStatsSize:]':
StatsSwarm.m:46: warning: multiple declarations for method `setValue:'
/usr/include/swarm/gui.h:473: warning: using `-setValue:(const char *)v'

Double.h:10: warning: also found `-setValue:(double)value'
StatsSwarm.m:46: incompatible type for argument 3 of indirect function
call

The SwarmStatistics object I define does not use gui.h and anyway
I was sure that the scope of the objects are differenet so that
"setValue"
in "gui.h" or in "Double" are different. The objc manual I have says the
same thing i.e.

A class can declare methods with the same names as methods in other
classes.
A class can declare instance variables with the same names as variables
in other classes.
An instance method can have the same name as a class method.
A method can have the same name as an instance variable.

Where am I going wrong???

Thank you, and best regards.

-Gadi-


                  ==================================
   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]