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
3
votes
0 answers

iOS Background task (NSThread) dies

Some days ago I posted a question about NSThread. Finally I managed to make it run in background every minute. The aim of the app is to get the location and then call to a webservice to update it on a server with ASIHTTPRequest every X minutes. The…
Ibaivi
  • 51
  • 4
3
votes
0 answers

Why is CLLocationManager giving me the wrong authorization status?

I'm building a running-based app in Swift that requests the user's location. For the sake of this question, let's just assume the app runs only on iOS 13+. Shortly after launching the app, we prompt the user for location access via the…
Brian Sachetta
  • 3,319
  • 2
  • 34
  • 45
3
votes
1 answer

iOS CLLocation Altitude Field - Ellipsoidal or Geoidal?

I was wondering if anyone would be able to provide insight into whether or not the altitude returned by the CLLocation object is an Ellipsoidal height or a Geoidal height? I know over in the Android world that the Location class has a member…
Charles Bisbee
  • 103
  • 1
  • 7
3
votes
2 answers

CoreData Predicate with Function Argument

I am attempting to include a function in a Predicate definition. Is this possible? Let's say you have a Core Data entity of Places with attributes for latitude and longitude. I would like to add annotations to a mapview of those Places within…
JohnSF
  • 3,736
  • 3
  • 36
  • 72
3
votes
2 answers

Update a label with speed every x seconds

I'm developing my first iPhone application. I have to update a label with the device speed every x seconds. I have created my own CLController and I can get device speed but I don't know if I have got to use NSTimer to update my label. How can I do…
Riccardo Queri
  • 1,025
  • 1
  • 10
  • 16
3
votes
2 answers

iPhone - CLHeading: how can I transform the trueHeading to a vector

I know how to get the coordinates of the magnetic heading: heading.x, heading.y, heading.z The thing is that I'd need the (x, y, z)-vector of the trueHeading. How can I create this vector? Thank you!
mrgremlin
  • 321
  • 2
  • 15
3
votes
2 answers

Reverse function of MKCoordinateRegionMakeWithDistance?

MapKit's built in function MKCoordinateRegionMakeWithDistance takes distances in meters and turns them into a MKCoordinateRegion: func MKCoordinateRegionMakeWithDistance( _ centerCoordinate: CLLocationCoordinate2D, _ latitudinalMeters:…
3
votes
3 answers

Showing an arrow that is heading a specific location

Does anyone know how to place out an arrow that points to a specific annotation depending on my current heading. For example; I want the arrow to be vertical when the current heading is the same as the annotation's coordinates. I am offering 50$ to…
3
votes
3 answers

How to detect when user pressed the "allow" when user location is requested

I am creating an app which uses the user's current location. At first run, after the user is prompted to allow or deny the app to use it's location, I want to do stuff when the user pressed the "allow" button. Is there a way to detect when the user…
user6120934
3
votes
1 answer

PHAsset CLLocation is not giving location same as photos app

We are fetching the latitude and longitude from PHAsset properties we are using CLGeocoder to reverseGeocodeLocation using following method. CLGeocoder * geoCoder = [CLGeocoder new]; [geoCoder reverseGeocodeLocation:loc…
AppleBee
  • 452
  • 3
  • 16
3
votes
3 answers

Location timestamp accuracy in ios

After analysing location services in iOS 10, found that some inconsistency is in the caching behaviour. Fetching locations in a periodic time (in my case every 20 secs) returns locations but their timestamps are not in chronologically ordered.…
ganka
  • 191
  • 1
  • 11
3
votes
0 answers

ios 10 programmatically turn on compass calibration in Location Services?

I was trying to figure out why the CLLocationManager true heading always returned -1.0. I found that Settings->Privacy->Location Services->System Services->Compass Calibration switch needed to be enabled. Now Im trying to find how to automatically…
Tim
  • 647
  • 1
  • 10
  • 21
3
votes
2 answers

How do I calculate velocity with Core Location?

i need to get the speed of my device (meters per seconds) and this is my code the speed is always 0 i don't understand. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation…
hugo411
  • 320
  • 1
  • 12
  • 29
3
votes
1 answer

How can I track iPhone usage like the 'Moment' app does?

How to track total usage of iPhone, even if our app is running in background(not forcefully terminated). Recently i have come across app, namely Moment this app does track your iPhone usages, even if this app is running in background. actually they…
Sheshnath
  • 3,293
  • 1
  • 32
  • 60
3
votes
1 answer

UIBackGround modes & iBeacons: app rejected

Apple rejected an iBeacon app because I checked "Location updates" in background mode. I made it quite obvious that the app monitors for iBeacons, this should also work in the background. Apple's response: "...Your app declares support for location…
Mathijs
  • 1,258
  • 1
  • 10
  • 27