core-location

CLLocationManager authorization issue iOS 8

巧了我就是萌 提交于 2019-11-27 02:17:17
问题 I am working on a piece of Swift code for iOS 8. I am trying to do something which involves location, and so i have implemented the following in my swift view controller file: let locationManger:CLLocationManager = CLLocationManager() var speedReceived:Double = 0 override func viewDidLoad() { super.viewDidLoad() locationManger.delegate = self locationManger.desiredAccuracy = kCLLocationAccuracyBest let authstate = CLLocationManager.authorizationStatus() if(authstate == CLAuthorizationStatus

Core Location not working in iOS 8

被刻印的时光 ゝ 提交于 2019-11-27 01:41:45
问题 I'm trying to use significant change location monitoring in iOS 8, but the didUpdateLocations method is never called. Here is the code for setting up the location manager: - (void)viewDidLoad { [super viewDidLoad]; CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; [locationManager requestWhenInUseAuthorization]; [locationManager startMonitoringSignificantLocationChanges]; } Despite calling requestWhenInUseAuthorization , nothing pops up to

How to get Location user whith CLLocationManager in swift?

£可爱£侵袭症+ 提交于 2019-11-27 01:12:42
I have this code on my view controller but this not working: import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate { var location: CLLocationManager! override func viewDidLoad() { super.viewDidLoad() location=CLLocationManager() location.delegate = self location.desiredAccuracy=kCLLocationAccuracyBest location.startUpdatingLocation() } func locationManager(location:CLLocationManager, didUpdateLocations locations:AnyObject[]) { println("locations = \(locations)") label1.text = "success" } I have the permisions how I read in other post. but I don't

CLLocationManager responsiveness

纵饮孤独 提交于 2019-11-27 00:48:42
问题 I have an app that revolves around the device's GPS and the information that comes from it. It is important that the location data be accurate and up-to-date. I know that the device is limited by its GPS and the GPS's limits, but I was wondering if there is anything I can do to tweak/improve the performance of the iPhone GPS, particularly in the speed area. Because location updates lag about 3-5 seconds behind the real-time location of the device, the velocity reported by the location manager

Simulating location changes for `startMonitoringSignificantLocationChanges`

泪湿孤枕 提交于 2019-11-27 00:36:30
问题 I am writing an iPhone app and using Location Services. I am using the startMonitoringSignificantLocationChanges method on CLLocationManager . (As I understand, this is for low power, low accuracy location services.) When I build and launch my app in iOS Simulator, it gets my location fine. However, I want to simulate updates to the location beyond the initial fix. I did notice these two options: iOS Simulator : Debug > Location menu Xcode 4: Product > Debug > Simulate Location menu Both of

How to find your current location with CoreLocation

孤街醉人 提交于 2019-11-27 00:14:51
I need to find my current location with CoreLocation , I tried multiple methods but so far my CLLocationManager has only returned 0's.. ( 0.000.00.000 ). Here's my code ( updated to work ): Imports : #import <CoreLocation/CoreLocation.h> Declared : IBOutlet CLLocationManager *locationManager; IBOutlet UILabel *latLabel; IBOutlet UILabel *longLabel; Functions : - (void)getLocation { //Called when needed latLabel.text = [NSString stringWithFormat:@"%f", locationManager.location.coordinate.latitude]; longLabel.text = [NSString stringWithFormat:@"%f", locationManager.location.coordinate.longitude]

iOS - MKMapView place annotation by using address instead of lat / long

≡放荡痞女 提交于 2019-11-27 00:05:25
I am able to place annotations on my MKMapView by using latitude and longitude, however, my feed coming in that I need to use location for is using street addresses instead of Lat and Long. e.g 1234 west 1234 east, San Francisco, CA ... Would this have something to do with the CLLocationManager ? Has anyone attempted this before? Based on psoft 's excellent information, I was able to achieve what I was looking for with this code. NSString *location = @"some address, state, and zip"; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder geocodeAddressString:location completionHandler:^

iOS: App is not asking user's permission while installing the app. getting kCLAuthorizationStatusNotDetermined every time - Objective-c & Swift

筅森魡賤 提交于 2019-11-26 23:56:01
I am trying to fetch user location in my iOS app. I have included corelocation framework in my project first. Then on a button click I am invoking the core location api as below. When I am trying to install this in a device, the core location never asks the user permission. When I try to fetch the location on button click, I am getting kCLAuthorizationStatusNotDetermined as the authorisationStatus. Please help me in this. I have no clue what is happening. - (IBAction)fetchLessAccurateLocation:(id)sender { [self.txtLocation setText:@""]; locationManager = [[CLLocationManager alloc] init];

NSUserDefaults losing its keys & values when phone is rebooted but not unlocked

雨燕双飞 提交于 2019-11-26 22:30:46
问题 We are currently experiencing the following weird issue with our iPhone app. As the title says, NSUserDefaults is losing our custom keys and values when phone is rebooted but not unlocked, and this is happening on a very specific scenario. Context: We are using the NSUserDefaults in the app to store user data (e.g. username). Our app has Location enabled on Background Mode. We are experiencing this issue only when distributing over the air or by Testflight. If I drag and drop the .ipa (same

deferredLocationUpdatesAvailable returns NO in iOS 10

不羁的心 提交于 2019-11-26 22:23:44
问题 I am trying to use some CoreLocation features, and I am running into problems with deferred location updates. For some reason when the app was updated for iOS 10 deferredLocationUpdatesAvailable returns NO always. I am testing on an iPhone 6s, so I know that the device is capable of using GPS features. I tried using this to debug: [CLLocationManager deferredLocationUpdatesAvailable] I can't figure out if this is an issue with iOS 10 or if I have something set incorrectly. In this method: -