I just started learning Objective C and I am trying to populate an array using the following method:
#import "ArrayCreator.h"
@implementation ArrayCreator
-(int) ArrayCreator: (int) size{
int i;
int a[size];
for (i=0; i<size; i++) {
a[i] = i+5;
}
return a; // Xcode give a warning here!!
}
@end
where size is parameter to be defined in the main.m document later. I am a bit confused on how to define this type of mutable array. I know of the existence of NSMutableArray, although I have seen in forums that people would rather use int a[size] to define this objects.