Questions tagged [cllocation]

A CLLocation object represents the location data generated by a CLLocationManager object. This object incorporates the geographical coordinates and altitude of the device’s location along with values indicating the accuracy of the measurements and when those measurements were made. In iOS, this class also reports information about the speed and heading in which the device is moving.

A CLLocation object represents the location data generated by a CLLocationManager object. This object incorporates the geographical coordinates and altitude of the device’s location along with values indicating the accuracy of the measurements and when those measurements were made. In iOS, this class also reports information about the speed and heading in which the device is moving.

Typically, you use a CLLocationManager object to create instances of this class based on the last known location of the user’s device. You can create instances yourself, however, if you want to cache custom location data or get the distance between two points.

This class is designed to be used as is and should not be subclassed.

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/doc/uid/TP40007126

810 questions
8
votes
2 answers

CLLocationManager not working all the time (iOS 8, Xcode 6)

Basically half the time the delegate method - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations; is not called at all. But the other half of the time it works perfectly! I've found that it usually happens…
8
votes
2 answers

How can I evaluate the GPS signal strength? (iPhone)

I need a way of categorising the strength of the GPS signal. So far I have come across the horizontalAccuracy property of CLLocation (Class Reference). To be more specific I need to create something like the following; the issue I'm having is…
user843337
7
votes
6 answers

didUpdateLocation Method Never Called

I am making one app on iphone sdk4.0.In that did update location method never called. I have given my code below.Please help.Thanks in advance. -(id)init { [super init]; obj=[[UIApplication sharedApplication]delegate]; locationManager…
Akshay Aher
  • 2,525
  • 2
  • 18
  • 33
7
votes
5 answers

Not being prompted to enable Location Services in App

UPDATE: THIS IS NOT A DUPLICATE. I have already added the required key to the info.plist as stated in my original question and the issue remains. I have tried all three keys in various combinations. Before anyone gets upset, I have read through many…
Andrew
  • 968
  • 2
  • 11
  • 22
7
votes
4 answers

Convert GPS coordinates to a city name / address in Swift

I have a latitude/longitude location that I want to convert to the location name String in Swift. What is the best way to do this? i believe it's best to use the reverseGeocodeLocation function but not exactly sure how to. This is what I have so…
Jeffrey G.
  • 85
  • 1
  • 1
  • 6
7
votes
2 answers

CLLocation distanceFromLocation (in Swift?)

Can somebody please help me convert the following Objective-C statement to Swift? CLLocationDistance distance = [fromLocation distanceFromLocation:toLocation]; I know that it must be simple to do that. I am brand new to iOS programming and any help…
Proteus
  • 93
  • 1
  • 4
7
votes
1 answer

Convert CLLocation or CLLocationCoordinate2D to CGPoint

How can I convert CLLocation or CLLocationCoordinate2D to CGPoint. I have seen CGPoint point = [mapView convertCoordinate:myCoordinates toPointToView:self.view]; But I don't need to use mapView in my case. I tried googling, but didn't come across…
Xavi Valero
  • 2,047
  • 7
  • 42
  • 80
7
votes
3 answers

How to store CLLocationCoordinate2D?

I'm attempting to build an application that builds and saves routes similar to map my run. I'm using the Breadcrumb sample code, specifically the CrumbPath and CrumbPathView as the base of my routes, from Apple. Two questions: If I try to access…
HighFlyingFantasy
  • 3,789
  • 2
  • 26
  • 38
7
votes
3 answers

CLLocation - Find magnetic declination / deviation at another location

I know how to find the true heading/magnetic heading for the location my phone is currently at, but is it possible to find the magnetic deviation/declination for a remote location? What I would like to do is be able to drop a pin at a place on the…
Steven Marlowe
  • 230
  • 2
  • 16
6
votes
2 answers

calculating 'timeIntervalSinceNow' with a negative value (CLLocation example)?

i don't understand this example from the doc : the timeIntervalSinceNow method should show a positive value, but how can we reach "5" as mentioned in the code? (i think it's either 0 more or less, or -10 , -20, -30 etc... but how can we get a…
Paul
  • 6,108
  • 14
  • 72
  • 128
6
votes
2 answers

How can I calculate the heading (N/W/S/E) given (x,y,z) magnetometer and accelerometer data?

I am using react-native-sensor to grab the raw data from these sensors. import {magnetometer, acclerometer} from 'react-native-sensors'; const subscription = accelerometer.subscribe(({ x, y, z, timestamp }) => console.log({ x, y, z, timestamp…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
6
votes
4 answers

Need to archive CLLocation data

I have an array of CLLocation data that I would like to archive. Should the NSUserDefaults system be used? Otherwise, how best to archive the CLLocation data?
devonsmith
  • 123
  • 2
  • 11
6
votes
2 answers

Converting CLLocationCoordinate2d to Street Address with Swift

Im trying to convert CLLocationCoordinates2d coordinates to a physical street address. I have tried CLGeocoder with no luck. Here is my code that supplies the latitude and longitude coordinates. let manager = CLLocationManager() func…
klykins
  • 95
  • 1
  • 6
6
votes
5 answers

Core Location region monitoring

Does anyone know any knowledge of using this: - (void) startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy I am trying to implement it into my project but: - (void) locationManager:(CLLocationManager *)manager…
jodm
  • 2,607
  • 3
  • 25
  • 40
6
votes
1 answer

How to get periodicaly new location when app is in background or killed

I want to get new location every 1min when my app is in background or killed. Here is my code : Location Service: class LocationService: NSObject, CLLocationManagerDelegate { static let shared = LocationService() var locationManager =…
YouSS
  • 560
  • 7
  • 20