If you create an NSArray you won’t be able to add elements to it, since it’s immutable. You should try using NSMutableArray instead.
Also, you inverted the order of alloc and init. alloc creates an instance and init initializes it.
The code would look something like this (assuming getData is a global function):
NSMutableArray *stringArray = [[NSMutableArray alloc] init];
for(int i=0; i< data.size; i++){
[stringArray addObject:getData(i)];
}