我正在尝试将我的MapKit View纬度和经度设置为来自NSStrings的值。虽然当我尝试设置它们时,我得到错误:
Assigning to 'CLLocationDegrees' (aka 'double') from incompatible type 'NSString *_ strong'
以下是我的代码
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = latitudevariable;
zoomLocation.longitude = longitudevariable;
两个变量都是NSStrings
答案 0 :(得分:1)
所以我将变量改为
zoomLocation.latitude = [latitudevariable doubleValue];
zoomLocation.longitude = [longitudevariable doubleValue];