简体   繁体   English

setNeedsDisplayInMapRect-不推荐使用iOS7

[英]setNeedsDisplayInMapRect - Deprecated iOS7

I am currently trying the Apple example Breadcrumb to track and draw a path where the user has been. 我目前正在尝试使用Apple 示例 Breadcrumb来跟踪并绘制用户所在的路径。

Having updated the base SDK to 7, it is alerting me that setNeedsDisplayInMapRect is deprecated as of iOS 7. I have looked in the reference documents and they advise that this should be replaced with MKOverlayRenderer . 将基本SDK更新为7后,提醒我setNeedsDisplayInMapRect自iOS 7起已弃用。我查看了参考文档,他们建议应将其替换为MKOverlayRenderer

As this is all new to me, I am struggling to fully grasp how to swap this around. 由于这对我来说是新事物,所以我在努力地掌握如何进行互换。 Does anyone have any experience with this and can explain how to do so? 有人对此有任何经验并可以解释如何做吗?

Change CrumPathView parent class to MKOverlayRenderer (available iOS 7.0 onwards) from MKOverlayView (deprecated on iOS 7.0) as both classes expose the same methods with couple of new extra methods introduced in MKOverlayRenderer. 将CrumPathView父类从MKOverlayView(iOS 7.0弃用)更改为MKOverlayRenderer(从iOS 7.0起可用),因为这两个类都公开了相同的方法,并且在MKOverlayRenderer中引入了两个新的额外方法。

Implement following MKMapViewDelegate's method (available in iOS 7.0 onwards) as a replacement for deprecated 实现以下MKMapViewDelegate的方法(在iOS 7.0及更高版本中可用)替代不推荐使用的方法

// Deprecated in iOS 7.0
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay

// Method to replace above deprecated method (available in iOS 7.0)
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM