我正在做一个应用程序。我正在使用CLLOcationmanager
下面的类似内容。
[self performSelectorOnMainThread:@selector(findlocation:) withObject:nil waitUntilDone:NO];
-(void)findlocation:(id)sender
{
//NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
locationManager=[[CLLocationManager alloc]init];
locationManager.delegate=self;
locationManager.distanceFilter=0.3f;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog@"%@",newlocation.timestamp];
}
我想每 0.3 米更新一次位置。但是这个委托方法不会针对那个距离触发。在[self performSelectorOnMainThread:@selector(findlocation:) withObject:nil waitUntilDone:NO];
我剩下的过程开始工作之后。