cllocationmanager

iOS 6 and Location Services not working

∥☆過路亽.° 提交于 2019-11-27 02:25:11
问题 I've updated my iOS SDK to version 6. After that I've compiled my app (works fine in iOS 4 & iOS 5 ) but now the location services doesn't work. My delegate isn't receiving any update and the upper location arrow is not appearing... I'm starting the service as the usual way: [locationManager startUpdatingLocation]; My project is non ARC. What is happening? This is driving me crazy... Thanks in advance. 回答1: Make sure you have a CFBundleDisplayName in your project's .plist file. Adding that

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

UIAlertView like “Turn On Location Services to allow maps to determine your location”. Settings + Cancel

这一生的挚爱 提交于 2019-11-27 02:01:40
问题 I Want to emit this alert: Turn On Location Services to allow maps to determine your location I need both "Settings" and "Cancel" exactly like the "maps" application. "Settings" should open settings->general->location services I didn't find the way to open the settings page. Can you help me? Thanks 回答1: Creating the alert is pretty straightforward, it's just a (faux-)modal UIView. However, it's not possible to open the Settings app programmatically, at least not without using private methods

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

How to check if MKCoordinateRegion contains CLLocationCoordinate2D without using MKMapView?

て烟熏妆下的殇ゞ 提交于 2019-11-27 00:37:52
问题 I need to check if user location belongs to the MKCoordinateRegion. I was surprised not to find simple function for this, something like: CGRectContainsCGPoint(rect, point) . I found following piece of code: CLLocationCoordinate2D topLeftCoordinate = CLLocationCoordinate2DMake(region.center.latitude + (region.span.latitudeDelta/2.0), region.center.longitude - (region.span.longitudeDelta/2.0)); CLLocationCoordinate2D bottomRightCoordinate = CLLocationCoordinate2DMake(region.center.latitude -

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:^

CLLocationManager and accuracy issues - any experiences?

别等时光非礼了梦想. 提交于 2019-11-26 23:58:37
问题 So I am dealing with some accuracy issues with iPhone GPS. I have an app which uses location. In the delegate method locationManager: didUpdateToLocation: fromLocation: I am being returned a location. From a bit of research, it appears the GPS isn't always accurate on the first result it returns, even when setting desiredAccuracy property to kCLLocationAccuracyBest . In order to get around this, I don't call stopUpdatingLocation before it's returned newLocation: at least 3 times (this is very

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];