I'm looking for a simple way to create strings with different names in a loop. something like this,
nsstring *str1;
nsstring *str2;
nsstring *str3;
just with a
for loop
to create about 100 of them.
I'm looking for a simple way to create strings with different names in a loop. something like this,
nsstring *str1;
nsstring *str2;
nsstring *str3;
just with a
for loop
to create about 100 of them.
Something like this:
NSMutableArray* array = [NSMutableArray array];
for(int i=1; i<=100; i++){
[array addObject:[NSString stringWithFormat:@"string%d", i]];
}
Array now should have 100 strings named like string1, string2, string3...and so on.