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
12
votes
2 answers

didEnterRegion firing for all my geofences

All my geofences are triggering when GPS enters a defined region, at first I thought it was because of the radius, however even after halving it I am having the same problem. import UIKit import CoreLocation class itemDesc { var title: String …
Magrafear
  • 573
  • 4
  • 17
12
votes
2 answers

How to calculate speed of our car using iphone

For my application I want to calculate my car/bike speed using iphone. How can i do that? Ideally, it should run continuously in the background.
Sukeshj
  • 1,503
  • 1
  • 19
  • 25
12
votes
2 answers

IOS Getting location updates when app terminated without using significantChange

I apologise for the redundancy of this topic, but in spite all the given answers, I can't identify the possibility of getting accuracyBest location updates when the app is terminated. I don't want to use monitoringSignificantChange, I want the best…
scoobyDoo
  • 123
  • 1
  • 5
11
votes
3 answers

Calculate Total Traveled Distance iOS Swift

How can I calculate the total distance traveled use CoreLocation in Swift I haven't been able to so far find any resources for how to do this in Swift for iOS 8, How would you calculate the total distance moved since you began tracking your…
YichenBman
  • 5,011
  • 8
  • 46
  • 65
11
votes
4 answers

CLLocationManager alert getting dismissed by itself

I am calling for current location whenever the user logs in, and at several other places. Whenever I do so, the alert view asking for permission by the user appears for a second or so, and then it gets disappeared. And obviously, I don't get the…
Nikita P
  • 4,226
  • 5
  • 31
  • 55
10
votes
2 answers

How do I update the location of an MKAnnotation object on a mapView?

I have the following code, which aims to loop through all the annotations on the current apple map view and update their location coordinates. for existingMarker in self.mapView.annotations { existingMarker.coordinate.latitude = 12.12121212 …
sometimesiwritecode
  • 2,993
  • 7
  • 31
  • 69
10
votes
4 answers

Encoding a CLLocationcoordinate2D

I am trying to encode annotations that are on a map, but I read that I am not able to encode CLLocationcoordinate2D variables. Does anyone know how I can solve this? Here is some code. This is where I drop the pins: -…
Chandler De Angelis
  • 2,646
  • 6
  • 32
  • 45
9
votes
1 answer

How to pull out latitude/longitude coordinates from MKMapItem

I'm creating an app that uses CoreData to store points of interest. MKMapItem coordinates are accessible within mapItem.placemark.location. I'd like to pull out the individual latitude and longitude coordinates and store them in a…
Adrian
  • 16,233
  • 18
  • 112
  • 180
9
votes
4 answers

How to get lat and long coordinates from address string

I have a MKMapView that has a UISearchBar on the top, and I want the user to be able to type a address, and to find that address and drop a pin on it. What I don't know is how to turn the address string into longitude and latitude, so I can make a…
Chandler De Angelis
  • 2,646
  • 6
  • 32
  • 45
9
votes
2 answers

CLLocation speed

I am developing GPS application. Do you know about how to detect speed of mobile device ? Actually, I need to detect the speed every 2 seconds. I know didUpdateToLocation method is called when location changed. -…
Ferdinand
  • 1,193
  • 4
  • 23
  • 43
9
votes
4 answers

Trouble with CLLocation method distanceFromLocation: Inaccurate results

I am trying to use the distanceFromLocation: method to calculate the total distance that I am walking with my iPhone in my hand. So far, I have been searching all over to help remedy my confusing, inaccurate, and seemingly arbitrary results. In…
bgottlob
  • 527
  • 2
  • 6
  • 14
8
votes
2 answers

CLLocationCoordinate2D without knowing how many will be in the array?

I need to build an array using something like the following: CLLocationCoordinate2D points[4]; points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116); points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066); points[2]…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
8
votes
3 answers

Objective-C - Search for streets based on user-entered query

I want to allow the users to search for a street name and have the results displayed in a UITableView. For the moment the region is not important, it can be from any region. I could not find any relevant example in my searches and I don't know if I…
CristiC
  • 22,068
  • 12
  • 57
  • 89
8
votes
3 answers

Saving Swift CLLocation in CoreData

I am trying to save CLLocation data in Core Data. My property is set as a Transformable object. Some sample code out there indicates one can save the location data using this objc converted to an NSValue. CLLocationCoordinate2D myLocation; NSValue…
Tommie C.
  • 12,895
  • 5
  • 82
  • 100
8
votes
4 answers

How to get current location latitude and longitude in IOS SDK 8.0

how to get current location latitude and longitude. I have try this. Using Xcode 6.01 and IOS SDK 8.0 -(CLLocationCoordinate2D) getLocation{ locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; …
KkMIW
  • 1,092
  • 1
  • 17
  • 27
1 2
3
53 54