mkreversegeocoder 和计时器

发布于 2024-08-29 18:32:53 字数 143 浏览 3 评论 0原文

我读过,使用 mkreversegeocoder 我可以每 60 秒执行一次查询。 我的 mkreversegeogoder 实例在 cllocation 检索一些信息后开始。 进行 60 秒查询的最佳方法是什么?计时器?或者玩我的旧日期的时间戳?或者其他一些东西? 谢谢

i've read that with using mkreversegeocoder i can do a query every 60 seconds.
my istance of mkreversegeogoder start after cllocation retrieve some info.
What's the best way to do a 60 seconds query? a timer? or play with timestamp of my olddate? or some other stuff?
thank's

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寄意 2024-09-05 18:32:53

您可以使用 NSObject's 在任意延迟间隔后调用具有反向地理编码器例程的选择器

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay

You can call a selector with reversegeocoder routine after an arbitrary delay interval using NSObject's

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay
赢得她心 2024-09-05 18:32:53

嗯,我不确定我是否了解如何使用...类似

- (void) onceGeocoding:(CLLocationManager *)manager didUpdateToLocation:(CLLocation  
*)newLocation
fromLocation:(CLLocation *)oldLocation  {
self.geoCoder = [[[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate] autorelease];
geoCoder.delegate = self;
[geoCoder start];
NSLog(@"myTimer started");
}

这样的东西是我的选择器,我用 ? 调用我的其他 istance 方法

[self performSelector:@selector(onGeocoding:) withObject:nil afterDelay:60.0];

mhmmm i'm not shure i've understand how to use.... something like

- (void) onceGeocoding:(CLLocationManager *)manager didUpdateToLocation:(CLLocation  
*)newLocation
fromLocation:(CLLocation *)oldLocation  {
self.geoCoder = [[[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate] autorelease];
geoCoder.delegate = self;
[geoCoder start];
NSLog(@"myTimer started");
}

this is my selector and i call in my other istance method with

[self performSelector:@selector(onGeocoding:) withObject:nil afterDelay:60.0];

?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文