我想同时在地图上显示多个注释。我遇到的问题是我将所有纬度和经度都作为 NSString ...
我想将字符串转换为双精度,以便可以传递给“CLLocationCoordinate2D”实例。但我收到错误消息:指针不能转换为“双精度”类型
locationCoordinate.latitude=(double)NearbyLocations.lat;
locationCoordinate.latitude=(double)NearbyLocations.lng;
这是我遇到问题的代码的一部分。但是,正如您可能看到的,我还没有完成它。
NSMutableArray *locations= [[NSMutableArray alloc]init];
CLLocationCoordinate2D locationCoordinate;
location *NearbyLocations;
Annotation *annotatedLocations;
//for (int i=0; i < locationOnMap.count;i++) {
annotatedLocations = [[Annotation alloc]init];
locationCoordinate.latitude=(double)NearbyLocations.lat;
locationCoordinate.latitude=(double)NearbyLocations.lng;
annotatedLocations.coordinate=locationCoordinate;
annotatedLocations.title=NearbyLocations.lo_name;
annotatedLocations.subtitle=NearbyLocations.lo_vicinity;
[locations addObject:annotatedLocations];
//}
我该怎么做才能将点类型的字符串转换为双精度