I have a long list of places with Latitudes and Longitudes in a plist. I want to show a tableView of the places only within X distance of the user's current location. Is there a way to create objects from the lats & longs in the plist file so I can use 'distanceFromLocation'? More importantly, how do I get the array to only display the names with a distance from current less than X? I'm assuming I would need to make a series of objects from lats & longs in the plist, then do an objects in array if objects distanceFrom is less than X, correct?

Please help.

Here's where I am now: I get an error on the double clubLatitude line

```
- (void)viewDidLoad {
 [super viewDidLoad];

     NSArray *clubArray = [NSArray arrayWithObjects:[self danceClubLocation], nil];
     self.tableData = clubArray;
}

-(CLLocation *)danceClubLocation
{
    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
    NSArray *array = [NSArray arrayWithContentsOfFile:plistPath];

    NSEnumerator *e = [array objectEnumerator];
    id object;
    while ((object = [e nextObject])) {
        double clubLatitude = [[array valueForKey:@"Latitude"] doubleValue];
        double clubLongitude = [[array valueForKey:@"Longitude"] doubleValue];
        CLLocation *clubLocation = [[CLLocation alloc] initWithLatitude:clubLatitude longitude:clubLongitude];
        if ([clubLocation distanceFromLocation:myLocation]<=50) {
            return clubLocation;
        }
        else return nil;
    }
    return nil;
}

-(CLLocation *)myLocation
{
    CLLocation *location = [locationManager location];
    CLLocationCoordinate2D coordinate = [location coordinate];
    NSNumber *myLatitude = [NSNumber numberWithDouble:coordinate.latitude];
    NSNumber *myLongitude = [NSNumber numberWithDouble:coordinate.longitude];
    double myLatitudeD = [myLatitude doubleValue];
    double myLongitudeD = [myLongitude doubleValue];
    myLocation = [[CLLocation alloc]initWithLatitude:myLatitudeD longitude:myLongitudeD];
    return myLocation;
}

```