【发布时间】:2017-08-12 06:31:31
【问题描述】:
我正在尝试删除一些用于在 MapView 中创建叠加层的贬低代码,现在我正面临这个警告:
从结果类型为“MKOverlayView * _Nonnull”的函数返回“MKCircleRenderer *”的不兼容指针类型
我已经阅读了很多关于这个问题的问答,但直到现在我都无法弄清楚。我的代码有什么问题?
// Create overlay
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay{
MKCircleRenderer *circleView = [[MKCircleRenderer alloc] initWithOverlay:overlay];
circleView.fillColor = [[UIColor cyanColor]colorWithAlphaComponent:0.5];
circleView.strokeColor = [[UIColor blueColor]colorWithAlphaComponent:0.8];
circleView.lineWidth = 1;
return circleView;
}
【问题讨论】:
标签: ios objective-c pointers mkmapview