【发布时间】:2011-08-01 13:38:13
【问题描述】:
我想知道如何将 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);
这会返回编译器的警告。
警告是
warning: passing argument 1 of 'NSLog' from incompatible pointer type
我该怎么做?
任何帮助将不胜感激。
谢谢
【问题讨论】:
标签: cocoa cllocation