I'm totally new to ObjC. I've already watched/read some tutorials. But now i would like to know how to make an array of objects and print out their values. I'm coming from a Java perspective. In Java it would look like this.
MyClass [] objects = new MyClass[100];
for(int i = 0; i < objects.length;i++)
int value = i;
objects[i] = new MyClass(value);
for(int i = 0; i < objects.length;i++)
println(objects[i].value);
How would the equivalent in ObjC look like? I've only come that far:
NSMutableArray * objects = [NSMutableArray arrayWithCapacity:100];
arrayWithCapacity:doesn't do what you think; it does not create an array with 100 empty slots.NSArray/NSMutableArrayare not sparse arrays.