CLLocationCoordinate2D の緯度と経度の値を数値または文字列値に変換する方法を知りたいと思っていました。Iver はいくつかの方法を試しましたが、うまくいきません:
CLLocationCoordinate2D centerCoord;
centerCoord.latitude = self.locModel.userLocation.coordinate.latitude ;
centerCoord.longitude = self.locModel.userLocation.coordinate.longitude;
NSString *tmpLat = [[NSString alloc] initWithFormat:@"%g", centerCoord.latitude];
NSString *tmpLong = [[NSString alloc] initWithFormat:@"%g", centerCoord.longitude];
NSLog("User's latitude is: %@", tmpLat);
NSLog("User's longitude is: %@", tmpLong);
これにより、コンパイラによって警告が返されます。
警告は
warning: passing argument 1 of 'NSLog' from incompatible pointer type
どうすればいいですか?
どんな助けでも大歓迎です。
ありがとう