NSPredicate问题

时间:2011-05-26 13:21:44

标签: ios mkmapview nspredicate

我想删除除RestaurantLocation或GrayRestaurantLocation之外的所有注释。

是正确的版本吗?

[mapView removeAnnotations:[mapView.annotations 
    filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:
       @"! ( (self isKindOfClass: %@) AND (self isKindOfClass: %@) )", 
      [RestaurantLocation class], [GrayRestaurantLocation class]]] ];

1 个答案:

答案 0 :(得分:3)

注释不能同时是RestaurantLocation和GrayRestaurantLocation。

AND更改为OR