CLLocationCoordinate2D 纬度和经度 NSString

CLLocationCoordinate2D Latitude and Longitude NSString

我正在尝试将我的 MapKit View 纬度和经度设置为来自 NSStrings 的值。尽管当我尝试设置它们时出现错误:

Assigning to 'CLLocationDegrees' (aka 'double') from incompatible type 'NSString *_ strong'

下面是我的代码

CLLocationCoordinate2D zoomLocation;

zoomLocation.latitude = latitudevariable;
zoomLocation.longitude = longitudevariable;

两个变量都是NSString

所以我将变量更改为此

zoomLocation.latitude = [latitudevariable doubleValue];
zoomLocation.longitude = [longitudevariable doubleValue];