Hello!
Very simple question - how might I iterate through a NSMutableArray and do things for each item?
Much like the for loop in other langs:
foreach(array){ dosomething(); }
Thanks! Christian Stewart
Hello!
Very simple question - how might I iterate through a NSMutableArray and do things for each item?
Much like the for loop in other langs:
foreach(array){ dosomething(); }
Thanks! Christian Stewart
If you want to call a method in each one, use
[array makeObjectsPerformSelector:@selector(eatFish)];
or if you want to pass an argument,
[array makeObjectsPerformSelector:@selector(eat:) withObject:myFishObject];