I am getting the following error: initWithPolyline
: is deprecated: first deprecated in iOS 7.0
MKPolylineView *lineView = [[MKPolylineView alloc]
initWithPolyline:overlay];
What is the replacement method of instead of this ?
I am getting the following error: initWithPolyline
: is deprecated: first deprecated in iOS 7.0
MKPolylineView *lineView = [[MKPolylineView alloc]
initWithPolyline:overlay];
What is the replacement method of instead of this ?
You will like to take a look to MKPolylineRenderer, specifically to -initWithPolyline (avalilable in iOS 7 and later).
You should use
(MKOverlayRenderer *)
type delegate instead of(MKOverlayView *)
type delegate. And returnMKPolylineRenderer
instead ofMKPolylineView
.See the documentation for
initWithPolyline:
. Read the Deprecation Statement which says to use anMKPolylineRenderer
object instead.