How to add elements to an array created by a 'for' loop ?
<p>I am using for loop for get distance from current location to destination location. I would like an array that contains all distances from current to destination location.</p>

<pre><code>for (i = 0; i &lt; [Arr_Lat count]; i++)  
{
    NSString *latst1 = [[NSString alloc]initWithFormat:[Arr_Lat objectAtIndex:i]];
    NSString *longst1 = [[NSString alloc]initWithFormat:[Arr_Long objectAtIndex:i]];

    NSLog(@"First lat : %@",latst1);
    NSLog(@"First  ong : %@",longst1);

    double Doblat1 = [latst1 doubleValue];
    double Doblong1 = [longst1 doubleValue];

    CLLocationCoordinate2D coord1 = CLLocationCoordinate2DMake(coord1.latitude = Doblat1, coord1.longitude = Doblat1);

    NSLog(@" Coordinat ==== : %f -- %f",coord1.latitude,coord1.longitude) ;

    CLLocation *currLoc = [[CLLocation alloc] initWithLatitude:appDel.curr_lat longitude:appDel.curr_long];

    CLLocation *destLoc1 = [[CLLocation alloc] initWithLatitude:Doblat1 longitude:Doblong1];

    NSLog(@" Currennt Location : %@", currLoc);
    NSLog(@" Destination Location : %@" , destLoc1);

    distance = [destLoc1  distanceFromLocation:currLoc];

    NSLog(@" Distance  :   ------- %0.3f", distance);

    DistStr = [[NSString alloc]initWithFormat:@" %f",distance];

    [currLoc release];

    [destLoc1 release];
    [Arr_title retain];

    [tbl_nearplace reloadData];
} 
</code></pre>
