Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 从mapView中删除注释时出现问题_Iphone_Crash_Mapkit_Mkannotation - Fatal编程技术网

Iphone 从mapView中删除注释时出现问题

Iphone 从mapView中删除注释时出现问题,iphone,crash,mapkit,mkannotation,Iphone,Crash,Mapkit,Mkannotation,我将添加的所有注释存储在一个单独的数组中。当我尝试删除已使用以下代码添加到mapView的注释时: if(![newClusters containsObject:cluster]){ [__mapView removeAnnotations:[__clusterAnnotations objectAtIndex:[__clusters indexOfObject:cluster]]]; [__clusterAnnotations removeObjectAtIndex:[__c

我将添加的所有注释存储在一个单独的数组中。当我尝试删除已使用以下代码添加到mapView的注释时:

if(![newClusters containsObject:cluster]){
    [__mapView removeAnnotations:[__clusterAnnotations objectAtIndex:[__clusters indexOfObject:cluster]]];
    [__clusterAnnotations removeObjectAtIndex:[__clusters indexOfObject:cluster]];
    [__clusters removeObject:cluster];
}
我得到以下错误:

-[ClusterAnnotationClass countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance
我不确定这意味着什么,我可以添加任何注释。从地图视图中删除时会崩溃


任何帮助都将不胜感激。

您正在调用
removeAnnotations
(复数),它接受注释数组,但看起来您传递的对象不是数组


也许你想打电话给removeAnnotation(单数)?

这是我的问题。谢谢你抓住它。