Tag: cllocationmanager

如何在每5分钟后从后台/前台获取应用程序的位置信息

我怎么才能得到它? -(void)updateLocation { [self performSelector:@selector(updateLocation) withObject:nil afterDelay:300]; [self.locationTracker updateLocationToServer]; } 但每次都不行

IOS didUpdateLocations称为多时间

我正在使用didUpdateLocation。 在里面,我叫了一个webservices。 而且,我想每2分钟一次,我会打电话给web服务。 但是,doUpdateLocation多次更新位置。 所以,我必须调用webservices。 不是很好。 如何每2分钟致电一次webservices。 请帮帮我!

位置不确定使用守护进程

试图获得位置使用ios的守护进程看着这个CLLocationmanager setAuthorizationStatus不起作用(越狱) 但不断确定位置不确定我有权利设置(与ldid检查) 得到了一个info.plist的二进制文件,并将下列关键字添加到clients.plist,但仍然无法获取位置 <key>com.apple.locationd.executable-{binary_path}</key> <dict> <key>Authorized</key> <true/> <key>BundleId</key> <string>{any_random_bundle}</string> <key>Executable</key> <string>{binary_path}</string> <key>Registered</key> <string>{binary_path}</string> <key>Whitelisted</key> <false/> </dict>

核心位置无法在viewDidLoad中获取数据

我写了一个简单的iOS应用程序,检索位置信息,然后使用该位置来请求雅虎天气。 问题是,即使我调用viewDidLoad中的核心位置,它不会立即给我的结果。 那为什么我不能得到位置信息? 如何获取viewDidLoad中的位置信息? 伪代码目前是这样的: – (void)viewDidLoad { [super viewDidLoad]; self.locManager = [[CLLocationManager alloc] init]; self.locManager.delegate = self; self.locManager.desiredAccuracy = kCLLocationAccuracyBest; self.locManager.distanceFilter = 100; [self.locManager startUpdatingLocation]; //won't get the current location right now, so the output will be null NSLog(@"Current Location Longitude: %@", self.longitudeString); NSLog(@"Current Location Latitude: %@", self.latitudeString); } -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { […]

在App的多个部分调用位置

我想使用下面的代码来查找用户在我的应用程序的多个部分的位置。 为了避免复杂性,我只想在一个地方获得用户的位置。 我会假设我需要把它放在我的appDelegate中,然后在需要使用它的时候从其他视图中调用它。 有谁知道我需要用什么来获取位置作为一个NSString的视图/选项卡比我的appDelegate? 谢谢! – (NSString *)deviceLocation { NSString *theLocation = [NSString stringWithFormat:@"latitude: %f longitude: %f", locationManager.location.coordinate.latitude, locationManager.location.coordinate.longitude]; return theLocation; } – (void)viewDidLoad { locationManager = [[CLLocationManager alloc] init]; locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m [locationManager startUpdatingLocation]; }

位置服务不适用于iOS 8

我在iOS 7上运行良好的应用程序不支持iOS 8 SDK。 CLLocationManager不返回一个位置,我也没有看到我的应用程序在设置 – > 位置服务 。 我在这个问题上进行了Googlesearch,但没有出现。 什么可能是错的?

每次都获得当前位置的警报

我正在尝试使用CLLocationManage获取设备当前位置。 我设置我的方法获取button单击位置。 我可以成功地获取位置,但是当我通过两个button“ 不允许 ”和“ 确定 ” 来获取带有“ APPNAME想要使用您的当前位置? 我点击“不允许”。 然后,每当我点击button,我不能得到该alertview再次获取当前位置,所以我无法获得位置。 那么,当我点击我的button来获取位置时,是否有可能每次获得alertview?

来自iOS9中CLLocationManager的奇怪位置

我开发了一个可以logging距离的漫游应用程序,在iOS7,iOS8上,虽然有时候不准确,但距离通常很好,但是在iOS9.0上,距离往往太大,所以我检查 – (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *) 定位方法,并find一些时间得到这样的位置:A,B,C,但C的坐标等于A,我认为这是奇怪的 我发现startUpdatingLocation调用一次,摆脱它后,它会变好,但仍然会发生 这里是演示源代码

调用CLLocationManager stopUpdatingLocation后内部GPS天线是否立即停止工作?

这是我的情况。 在我的应用程序中不需要连续监视用户的位置,但我需要的位置尽可能准确。 所以我只是调用CLLocationManager startUpdatingLocation与kCLLocationAccuracyBestForNavigation设置为所需的准确性,并获得我想要的准确性(通过比较newLocation.horizo​​ntalAccuracy与预定义的值)的位置后,我想停止位置更新和撤销更新几秒钟后再次。 但是当我打电话给stopUpdatingLocation状态栏的位置图标大约10秒后消失,这是否意味着苹果已经考虑到这种情况,当用户调用stopUpdatingLocation它不closures天线一段时间,可能是因为把它们回来在能源方面有些贵,所以他们只是等了一段时间,才closures了天线。 或者可能只是简单的位置图标不会消失,但天线closures。 那么有人可以解释什么时候有人调用stopUpdatingLocation?

即使应用程序在iOS中终止,也会持续更新位置

任何人都可以帮助我获取设备的位置,即使应用程序终止。 我知道如何获得应用程序在后台的位置。 但是,当用户closures/终止应用程序时,我仍然无法获得它。 谢谢,尼莱什