OGeek|极客世界-中国程序员成长平台

标题: ios - NSPredicate 问题 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 07:50
标题: ios - NSPredicate 问题

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

版本是否正确?

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



Best Answer-推荐答案


注释不能同时是 RestaurantLocation 和 GrayRestaurantLocation。

AND 更改为 OR

关于ios - NSPredicate 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6139172/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4