|
From: | Paul Johnson |
Subject: | Re: [Swarm-Support] Selectors |
Date: | Wed, 09 Jul 2003 09:31:51 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
But please just consider taking the simple, direct route: iterate over your list.
id <Index> index = [list begin: [self getZone]]; id anObj; for (anObj = [index next]; [index getLoc]==Member; anObj = [index next]) { [anObj setPayoff: pay]; } Marcello wrote:
Pardon me the frequency of my questions! I have a method in a class Agent: - setPayoff: (float) p { payoff=p; return self; } Now, in another class, I have a List of Agent called "group". I'd like to pass through the list and set the payoff as follows: float pay=10.1; [group forEach: M(setPayoff:): pay ]; If I do that, I get gcc: incompatible type for argument 4 of indirect function call if I set [group forEach: M(setPayoff:): (id) pay ]; id does not work either, it only works if : [group forEach: M(setPayoff:): (int) pay ]; but then pay is always zero. Any help? thanks marcello
-- Paul E. Johnson email: address@hidden Dept. of Political Science http://lark.cc.ku.edu/~pauljohn University of Kansas Office: (785) 864-9086 Lawrence, Kansas 66045 FAX: (785) 864-5700
[Prev in Thread] | Current Thread | [Next in Thread] |