NSPredicate question
I want to delete all annotations except RestaurantLocation or GrayRestaurantLocation.
is it correct version ?
[mapView removeAnnotations:[mapView.annotations
filteredArrayUsin开发者_如何学编程gPredicate:[NSPredicate predicateWithFormat:
@"! ( (self isKindOfClass: %@) AND (self isKindOfClass: %@) )",
[RestaurantLocation class], [GrayRestaurantLocation class]]] ];
An annotation can't be both a RestaurantLocation AND a GrayRestaurantLocation.
Change the AND
to OR
.
精彩评论