相关疑难解决方法(0)

将CLLocationCoordinate2D类型转换为数字或字符串

我想知道如何将CLLocationCoordinate2D的纬度和经度值转换为数字或字符串值.我尝试了几种不同的方法,但他们没有工作:

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);
Run Code Online (Sandbox Code Playgroud)

这会返回编译器的警告.

警告是

warning: passing argument 1 of 'NSLog' from incompatible pointer type
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

任何帮助,将不胜感激.

谢谢

cocoa cllocation

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

cllocation ×1

cocoa ×1