Search code examples
iosobjective-cmkmapviewmkoverlay

Filtering Mkoverlay array


I am trying to filter out arrays of MKOverlays using predicate but I am getting exception.

    NSArray *pointsArray = [viewController.mapView overlays];
    MKPolyline *myLine = (MKPolyline *)[pointsArray objectAtIndex:0];
    NSMutableArray *mutablePonts = [pointsArray mutableCopy];

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"title != TRIP"];
    [mutablePonts filterUsingPredicate:predicate];

I want to filter out those overlays whose title is TRIP. I am getting exception

[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key TRIP.


Solution

  • You need to put quotes around TRIP.