【发布时间】:2011-04-26 06:08:31
【问题描述】:
我希望我的应用通过定位服务继续在后台运行。为此我使用过:
-(void)applicationDidEnterBackground:(UIApplication *)application {
[locationManager stopUpdatingLocation];
[locationManager startUpdatingLocation];
//timer=[NSTimer scheduledTimerWithTimeInterval:300 target:self selector:@selector(UpdateLocation) userInfo:nil repeats:YES];
}
但是当我使用NSTimer 时,它不会调用UpdateLocation。我尝试使用另一种方法调用它,但它也只调用了一次。
我想在后台连续运行应用程序,定期检测位置。
【问题讨论】:
标签: iphone ios cocoa-touch cllocationmanager