2011-05-26 187 views
2

我想刪除除RestaurantLocation或GrayRestaurantLocation之外的所有註釋。NSPredicate question

它是正確的版本嗎?

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

回答

3

註解不能同時是餐廳位置和格雷餐廳位置。

AND更改爲OR