我想同時在地圖上顯示多個註記。我有的問題是,我有所有的經度和NSString ...無法投射指針以輸入'double'
我想將字符串轉換爲雙重,以便我可以傳遞給「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];
//}
我能做些什麼來輸入字符串投點爲雙
您正在使用哪種語言? –
Marc,它看起來非常像Objective-C – akalenuk
所以對不起,我正在使用Objective-c!完全忘了說! – Mohammed