Hey guys! Now I have one trouble for develope one iPhone app. I need to compute 150 parts and draw it on canvas. I have code like this:
for (int i=x1; i<=x2; i++) {
for (int j=y1; j<=y2; j++) {
x=[NSNumber numberWithInt:i];
y=[NSNumber numberWithInt:j];
BoxCache *box = [[cache objectForKey:x] objectForKey:y];
if (box) {
ret.count += [box.species count];
}
[x release];
[y release];
}
}
His execution tired ~5 secs (computing array 15x10), I would like to ask everyone, any ideas to reduce compute time or do that different.