【发布时间】:2017-11-21 10:28:23
【问题描述】:
我只是比较两个值,但有时应用程序崩溃。如何处理。
NSString * markerid = [_selectedCoordinate objectForKey:@"markerid"];
for(CustomAnnotations *annotation in _mapView.annotations){
if(annotation.tag == [markerid integerValue]){
[_mapView selectAnnotation:annotation animated:NO];
return;
}
}
【问题讨论】:
-
我在 viewWillAppear 中运行代码。
-
给它下断点...
-
异常断点,具体来说。
-
One/many/all
annotation是MKUserLocation类的对象,而不是CustomAnnoation的对象,这就是它崩溃的原因。
标签: ios objective-c location