所以我有一个包含 10 个条目的数组。每个条目都有一个“CustomeObj”类型的对象。在每个对象中,我存储了一个 NSString 和一个 CLLocation var。 (类似于:“John”、“(23.33f, -32.44f))作为 map 引用。
现在,我想访问 CLLocation 变量中的这些数字:
NSLog (@"%f", obj.cllVar->latitude);返回 0,0000,但调试器中的真正 lat var 具有实际值。是否有双重连接:“obj.cllVar.lat”或者是否有另一种方式来拉拉或拉长。使用不同的运算符从 cllVar 中取出
非常感谢。
最佳答案
只需深入了解 CLLocation
获取包含 lat & lon 的 CLLocationCoordinate2D:
CLLocation *location = ...
CLLocationDegrees latitude = location.coordinate.latitude;
CLLocationDegrees longitude = location.coordinate.longitude;
关于ios - 如何从 CLLocation 变量中提取经度和纬度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19986303/