cllocationmanager

Can I get the accuracy of GPS location in iOS?

核能气质少年 提交于 2019-12-07 06:54:08
问题 I've seen Android developers get the accuracy of a GPS location. Is there a way that I can get the accuracy of my currenct GPS location in iOS? I am using the code from this answer to get my location: locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; - (void)locationManager:(CLLocationManager *)manager

Will an iOS app that monitors signficant location changes be restarted on device reboot?

徘徊边缘 提交于 2019-12-07 06:10:45
问题 From the Core Location documentation: The regions you register with the location manager persist between launches of your application. If a region crossing occurs while your application is not running, the system automatically wakes up your application (or relaunches it) in the background so that it can process the event. When relaunched, all of the regions you configured previously are made available in the monitoredRegions property of any location manager objects you create. Unfortunately,

iphone app: Questions on interaction between CLLocationmanager and MKMapView (showing current user location)

浪尽此生 提交于 2019-12-07 05:25:19
问题 In my iPhone app, I have the following logic: Start CLLocationManger (the user can supply accuracy and distance filters parameters to locationmanager, since best accuracy is not required in my case, 100-300 meters will do fine, and I'd like to save battery on this). After GPS fix is obtained by LocationManager (and only if this fix is obtained), I create and display the map. Both CLLocationManager and MKmapView are part of the same ViewController. To show the current location, I set mapView

CLLocationManager kCLErrorDomain Codes?

拜拜、爱过 提交于 2019-12-07 04:38:40
问题 Using iBeacon and CoreLocation I'm receiving the following error: Error Domain=kCLErrorDomain Code=16 "The operation couldn’t be completed. (kCLErrorDomain error 16.) Unless I'm missing it, there doesn't seem to be a clear reference on Apple for what each of the error code means. Can anyone interpret this error code? The error calls from: - (void)locationManager:(CLLocationManager *)manager rangingBeaconsDidFailForRegion: (CLBeaconRegion *)region withError:(NSError *)error{ NSLog(@"%@", error

Not updating the current location in MKMapView

瘦欲@ 提交于 2019-12-07 01:19:33
I am using CLLocationManager to update the current location but some times the current location is lost. I don't know why the current location is losing. Please help me out of this. Thank you, Madan Mohan The location can become lost for a wide variety of reasons: The device no longer has reasonably open access to the sky so GPS satellite information is unavailable. There aren't enough cell towers available to perform triangulation. The wifi access point isn't in the database of known access points. The user switched to Airplane Mode. And many more. Location-aware applications have to assume

iBeacons: If app is in background, locationManager: didEnterRegion: is called only when lock screen displayed

走远了吗. 提交于 2019-12-06 20:12:56
问题 I'm working on an iOS app that monitors for iBeacon regions. When the app is running in the background, I want it to send a local notification whenever it encounters a particular iBeacon region. Everything works fine, except for one thing: locationManager: didEnterRegion evidently doesn't get called until the user displays the lock screen. So even if the device passed through an iBeacon region while the app was in the background, they don't get the notification until they display the lock

On which iOS devices exactly is region monitoring supported?

时光怂恿深爱的人放手 提交于 2019-12-06 18:50:22
问题 From what I can interpret from the runtime requirements of sample region monitoring code of Apple, region monitoring is available on iPhone 4, iPad 2 Wifi + 3G or later. So I'm assuming that it's not available on iPad1 with 3G, or iPhone 3G/3GS. Is this a correct interpretation? I cannot test this since I don't have all those devices and I couldn't find an official documentation about this. PS: I know that I can check for it in the code by calling regionMonitoringAvailable method but I need

iOS Region Monitoring not working

白昼怎懂夜的黑 提交于 2019-12-06 14:21:26
I have been doing some iOS development for a couple of months and recently I am developing a bus app. I am currently mimicking the bus' movements and set up multiple annotations on the bus stops. For test purposes, I have setup just one bus stop and am trying to monitor when the bus has entered this region and exited as well. Strangely, my didStartMonitoringForRegion method is called perfectly but neither the didEnterRegion nor didExitRegion methods are called. Every time I run the program, the bus pretty much passes the stop without prompting me so. Could someone explain to me why this is

Calculating angle between two vectors?

a 夏天 提交于 2019-12-06 12:41:50
问题 I'm developing an iOS app, which has to show POIs (points of interest) depending on device heading. I used CLLocationManager to get user's location and heading. I have one pair of destination's coordinates. Based on this I'm calculating which quarter is that and returning float value of deviation from south (0 degrees) in degrees. I have -/+180 degrees in the north and 0 in the south. Here is code snippet: -(float)updateTargetLongitude:(float)lon Latitude:(float)lat{ // //longitude = x // /

iPhone Core Location CLLocationManager update rate

前提是你 提交于 2019-12-06 12:41:36
问题 Can you set up a constant time update rate for CLLocationManager to force it update locations like every 10 seconds continuously? I know the usage of the distance filter but what if something went wrong and the location is not updated? Thanks! 回答1: It's not possible to control the update rate. You can set a timer, then turn off the updates until the timer ends. This is the usual thing to do to avoid using too much power. If there's a problem, you will be informed by the delegate method