cllocationmanager

singleton for location updating multiple views

非 Y 不嫁゛ 提交于 2019-12-03 20:48:11
I want to update user location in ALL views, after the locateButton in the navbar is pressed in ANY view. I've started by creating a singleton. Location.h #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> #import <MapKit/MapKit.h> @interface Location : NSObject <CLLocationManagerDelegate> @property (nonatomic, strong) CLLocationManager* locationManager; + (Location*)sharedSingleton; @end Location.m #import "Location.h" @implementation Location { CLLocationManager *locationManager; CLGeocoder *geocoder; CLPlacemark *placemark; } @synthesize locationManager; - (id)init {

CLLocationManager monitoredRegions (NSSet) is not correct, or maybe something else?

拥有回忆 提交于 2019-12-03 17:40:39
I want to check every time the user passes a store from an array of stores, I have more than 20 stores so I wrote a function that finds the 20 closest stores to the user’s location and monitors them. The list being updated on locationManager: didUpdateLocations , I also replace the old 20 monitored regions with the new 20 closest stores location. The problem is that locationManager: didEnterRegion isn’t being called regularly when the user enters a region. I’ve also noticed that when I check the locationManager.monitoredRegions NSSet the regions there are wrong for some reason (I checked it

iOS: Can I manually associate wifi network with geographic location?

十年热恋 提交于 2019-12-03 16:53:34
Is it possible to make the phone to "know" that a specific wifi network is at specific geographic location? if (answer == YES) { than how? } else { can the phone figure this out by himself? } Another similar question: is there any way to start monitor a region with accuracy of ~100m but telling the CLLocationManager to use only by wifi networks and cellular antenas? Because I don't want to power up the GPS no matter what... Thanks! iPhone positioning sucks and there is nothing you can do. If you jailbreak your device you can use the Apple80211 private framework to look up the available Wi-Fi

Check if system time is auto or user set

孤街醉人 提交于 2019-12-03 16:50:56
I need to set up user proof time keeping in my current project. I have found a lot of different question around this, but none that seem to have the answer I am looking for. These are the questions i have looked at so far: XCODE: How to get/verify ACCURATE timestamp from device Is it possible to get the atomic clock timestamp from the iphone GPS? How can I get the real time in iPhone, not the time set by user in Settings? I have several options for getting a time from a server connection but I need to have an offline solution too. 1. It seems that using CLLocation gets the same time as as the

iOS re-check location on load from background

倖福魔咒の 提交于 2019-12-03 16:35:05
I'm building an app which displays result data based on your current location. At the moment, I'm using the viewDidLoad method of a UIViewController to start the CLLocationManager and getting the current location. Once I have the location that matches the accuracy I desire, I do a request to my web service to get the results and dump it into a UITableView . My problem is that when you close the app (although it's still running in the background). If you were to drive to another town, re-open the app, the data doesn't get updated and continues to show the results from your old location.

Objective C - CLLocationManager find out when “Allow” or “Don't allow” is clicked

妖精的绣舞 提交于 2019-12-03 16:34:58
When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location? I tried this but this doesn't get called after a user "Allow" or "Don't allow". - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status; Also, is there a variable that will tell me what the user selected? I tried the below, but that always returns true. locationManager.locationServicesEnabled Thank you, Tee There is a delegate method for that - (void)locationManager:

Swift LocationManager didChangeAuthorizationStatus Always Called

北城以北 提交于 2019-12-03 14:41:19
问题 I have a view controller which implements the CLLocationManagerDelegate . I create a the CLLocationManager variable: let locationManager = CLLocationManager() Then in the viewDidLoad , I set properties: // Set location manager properties locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters locationManager.distanceFilter = 50 The problem comes that the function gets called even before I check the authorization status. func locationManager(manager:

didEnterRegion called with larger radius (iOS)

谁说我不能喝 提交于 2019-12-03 14:04:26
问题 I want didEnterRegion to be called with much precision, but I wasn't able to do so. Here is what I have done: I used the best values of distanceFilter and desiredAccuracy (most precise GPS settings according to Apple) and have a destination CLCircularRegion (Subclass of CLRegion). self.locationManager.distanceFilter = kCLLocationAccuracyBestForNavigation; self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; @property (nonatomic, strong) CLCircularRegion *Destination;

difference between desiredAccuracy and distanceFilter

旧时模样 提交于 2019-12-03 13:52:19
Sorry for being a noob here. I am not able to clearly differentiate between CLLocationManager's properties distanceFilter and desiredAccuracy . If I want my application to give different coordinates for even small distances (say 100-200 metres) what values should i set for these properties. Help would be greatly appreciated. According to developer.apple.com distanceFilter The minimum distance (measured in meters) a device must move laterally before an update event is generated. That means, based on previous location event, another location update will only be received after exceeding

CLLocationManager.location is nil

随声附和 提交于 2019-12-03 12:46:12
this is my locationManager init method: func initLocationManager() { seenError = false locationFixAchieved = false locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation() } after calling this method this line println(self.locationManager.location) prints nil why is that? it worked for me well at the past i just made few changes in my app and it doesn't work well now.. 1) CLLocation location documentation - The value of this property is nil