[英]Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SWRevealViewController revealToggel:]
[英]Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation tag]:
我只是比较两个值,但有时应用程序崩溃。 如何处理。
NSString * markerid = [_selectedCoordinate objectForKey:@"markerid"];
for(CustomAnnotations *annotation in _mapView.annotations){
if(annotation.tag == [markerid integerValue]){
[_mapView selectAnnotation:annotation animated:NO];
return;
}
}
地图注释也包含用户位置注释,请检查[annotation class] != [MKUserLocation class]
或[annotation class] == [CustomAnnoation class]
然后获取注释的标签
NSString * markerid = [_selectedCoordinate objectForKey:@"markerid"];
for(CustomAnnotations *annotation in _mapView.annotations){
if([annotation class] != [MKUserLocation class]) {
if(annotation.tag == [markerid integerValue]) {
[_mapView selectAnnotation:annotation animated:NO];
return;
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.