提问人:Tricodoro 提问时间:3/3/2014 最后编辑:Tricodoro 更新时间:3/16/2014 访问量:117
NSMutable 数组错误 & showAnnotations
NSMutable array error & showAnnotations
问:
我有以下情况。我开发了一个应用程序,可以经常检索 POI 的值,我想在地图上显示为注释。为此,我编写了以下方法,在检索到一组新的 POI 后调用:
-(void)showAnnotation{
[self removeAllPinsButUserLocation];
annotationArray = [[NSMutableArray alloc] init];
for (Poi *poi in [parser.pois allValues]) {
myAnnotation *arr = [[myAnnotation alloc] init];
arr.title = [NSString stringWithFormat:@"%@ (%@)",poi.description, sensor.name];
arr.subtitle = [NSString stringWithFormat:@"%@, %@ %@",poi.street, poi.postalcode, poi.city];
arr.coordinate = CLLocationCoordinate2DMake(poi.lattitude, poi.longitude);
[annotationArray addObject:arr];
arr = nil;
}
[self.mapView addAnnotations:annotationArray];
[self.mapView showAnnotations:annotationArray animated:NO];
}
问题是我收到一个错误(由于未捕获的异常“NSGenericException”而终止应用程序,原因:“* 集合<__NSArrayM:0x14ebe9b0>在枚举时发生了突变。
但是,仅当我在最后一行中设置 animated:NO,而不是设置为 animated:YES 时......
有人对此有答案吗?
感谢您的回复!
Eelco公司
答: 暂无答案
评论
parser.pois