如何将NSValue转换为CLLocationCoordinate2D

时间:2018-09-26 11:12:52

标签: ios objective-c cllocationcoordinate2d

如何将NSValue转换为CLLocationCoordinate2D

我在NSValue中收到了(NSArray *)coordinateArray,并且需要为数组中的每个CLLocationCoordinate2D获取NSValue

1 个答案:

答案 0 :(得分:1)

Obj-C

#import <MapKit/MKGeometry.h> 

NSValue *coordinateValue; 
CLLocationCoordinate2D coordinate = [coordinateValue MKCoordinateValue];

Swift 4.x

let coordinateValue: NSValue = NSValue.init()
let coordinate: CLLocationCoordinate2D = coordinateValue.mkCoordinateValue