开发者

NSPredicate question

开发者 https://www.devze.com 2023-03-08 08:29 出处:网络
I want to delete all annotations except RestaurantLocation or GrayRestaurantLocation. is it correct version ?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消