【发布时间】:2014-01-20 00:37:08
【问题描述】:
我正在尝试将 self.mapView.userLocation.location 保存在内存中 CLLocation 属性中,但是在我将值分配给该属性并检查该属性的值后,我得到了这个:
<+0.00000000,+0.00000000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 1/19/14 4:21:14
这是我的代码:
.h:
@property (retain, nonatomic) CLLocation *currentlocation;
在我的.m上
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
if (self.currentlocation != self.mapView.userLocation.location)
{
self.currentlocation = self.mapView.userLocation.location;
}
}
我的问题是谁能保留 self.currentlocation 上 self.mapView.userLocation.location 的值并将其保留在内存中?
非常感谢您的帮助。
【问题讨论】:
-
你把mapView的
showUserLocation设置为true了吗? -
是的,self.mapView.showsUserLocation = YES;
标签: ios iphone mkmapview xcode5 cllocation