开发者

mkreversegeocoder and timer

i've read that with using mkreversegeocoder i can do a query every 60 se开发者_StackOverflow中文版conds. 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


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


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];

?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜