swarm-hackers
[Top][All Lists]
Advanced

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

[swarm-hackers] Swarm, Heatbugs, and forEach loops...


From: Nima Talebi
Subject: [swarm-hackers] Swarm, Heatbugs, and forEach loops...
Date: Tue, 10 Nov 2009 21:52:48 +1100

Hi, I'm a little confused (as I usually am looking at Swarm) on how iteration is supposed to work...

I have added some sliders and input widgets to my own branch of heatbugs, and so each time the user acts on these input widgets, I need to update the state variables stored in each Heatbug object.

For example, I would like to have something like this...

- (void)reconfigureHeatbug:(Heatbug *)hbug;


- (void)reconfigureHeatbugs {

    int i;

    Heatbug *hbug;

    for(i=0; i<numBugs; i++) {

        hbug = [heatbugList objectAtIndex:i];

        [self reconfigureHeatbug:hbug];

    }

}    


Of course that's not possible, as the heatbugList is not an NSArray, it is an id conforming to the <List> protocol.  Looking at surrounding code, I think maybe I'm supposed to do something along the lines of...

- (void)reconfigureHeatbugs {

    id fEAction = [modelActions createActionForEach:heatbugList

                                            message:M(reconfigureHeatbug:)];

}


..but that's obviously wrong since I have no idea what I'm doing - and what is M?

As a side-question - What would make life easier is being able to highlight a function/method/class/whatever in Xcode - say M - then right-click and select 'Jump to definition' - Anyone know how I can get that working?

Nima

reply via email to

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