I'm trying to generate integer array using for loop. Here is my code:
int total = 20;
for(int x = 0; x < total; x++)
{
NSArray arr = [NSArray arrayWithObjects: [NSNumber numberWithInt:total]];
}
With the above implementation I get only one object in array, the last one. What to do so arr to contain the numbers from 1 to 20 ?