代码之家  ›  专栏  ›  技术社区  ›  Lee Armstrong

mapkit未删除所有注释

  •  3
  • Lee Armstrong  · 技术社区  · 15 年前

    Mapkit似乎有个奇怪的问题!!!!

    我有一些添加了注释的代码,然后我调用

    NSArray *existingpoints = mapView.annotations;
    [mapView removeAnnotations:existingpoints];
                    if ([mapView.annotations count] > 0) {
                        for(Plane *annotation in mapView.annotations){
                            NSLog(@"Name: %@",annotation.reg);
                            [mapView removeAnnotation:annotation];
                        }
                        NSLog(@"\nMapCount:%i after attempting manual remove",[mapView.annotations count]);
                    }
    

    现在奇怪的一点是,有时我可以进入mapview.annotations计数大于0。因此,我有额外的“保护”,并尝试手动删除该项目,以使NSLogged退出。

    然而,最终的计数还是1!

    最奇怪的!

    1 回复  |  直到 15 年前
        1
  •  2
  •   Lee Armstrong    15 年前

    已经用苹果记录了一个错误…

    他们承认这是4.2的问题。