core-location

how do I detect location service disable for my app?

IOS4 has recently introduced the possibility to enable/disable location services for a specific application. I need to detect if this settings is enabled/disabled for MY application. First I have tried with: if ([CLLocationManager locationServicesEnabled]) { .... } however this refers to the global location service a...

Get rid of cached data in didUpdateToLocation

I'm trying to get the actual position on the iPhone Simulator. But I always get the cached result. My question is related to this and this question. I'm using the code from the LocateMe example: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)ol...

Definitive algorithm for determining most accurate returned from iPhone CoreLocation??

Has anyone nailed this down yet? I've read a lot of forum postings and I still can't tell if this is a settled question... Given that didUpdateToLocation() can return cached or inaccurate information how do you tell when you have an accurate fix? When you set desired accuracy to kCLLocationAccuracyNearestTenMeters, HundredMeters, Kilom...

Testing current location in Iphone simulator

I have integrated the myAnnotationview custiomed api in to my project.And i have added some address on it.I want to test it from iphone simulator.Is it possible?How can i achieve it?Do i need to ON anything in Simulator? Thanks ...

distanceFromLocation - Calculate distance between two points

Hello, Just a quick question on Core Location, I'm trying to calculate the distance between two points, code is below: -(void)locationChange:(CLLocation *)newLocation:(CLLocation *)oldLocation { // Configure the new event with information from the location. CLLocationCoordinate2D newCoordinate = [newLocation coo...

distanceFromLocation - Total Distance not being calculated correctly

Hello I trying to calculate the total distance travelled and output it to the View Controller, but the results are not as expected. Code is as follows: MyCLController.m - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { v...

When/where to startUpdatingLocation?

The determination of a position takes some time. When and where should the location manager be started? Now I'm starting the location update one view before the result view (which needs the location) is loaded. If the user taps to fast I get 0.0 coordinates. To get the right timing the startUpdatingLocation should be called three views...

Example for startMonitoringSignificantLocationChanges

I am new to iPhone programming. I am looking for an example or a demo on how to use startMonitoringSignificantLocationChanges method with the CoreLocation Manager. I am confused by the documentation because, I am not sure if the same delegate method is called as in the case of invoking startUpdatingLocation. (i.e. the delegate location...

CLLocation Category for Calculating Bearing w/ Haversine function

I'm trying to write a category for CLLocation to return the bearing to another CLLocation. I believe I'm doing something wrong with the formula (calculous is not my strong suit). The returned bearing is always off. I've been looking at this question and tried applying the changes that were accepted as a correct answer and the webpage i...

iPhone Core Location: Calculate total elevation loss/gain

I am wanting to calculate total elevation loss and gain at the end of recording Core Location data. I am having a hard time thinking of the math for this one. Say if I started at 600 feet and I go up and down during the tracking, how would I calculate my elevation gain and loss? Ideas? ...

Detect iPhone device capabilities for Core Location

I have a core location app that I'm writing leveraging the startMonitoringSignificantLocationChanges method to generate updates when appropriate but this does not work on older devices such as iPhone 3g. I would like for the core location functionality to still work while the device is open, so I thought I could use a selector test to...

What is the fastest way to sort a lot of locations on distance?

I want to sort lots of locations (waypoints) on their distance from the current location. The current location is, of course, a moving target, so for every location update, recomputing the distance for every location is necessary. But only recomputing for close-by locations would by enough. I currently use core-data, and store the dista...

how to hide message of asking user to allow to access your location in core location frameworks?

i want to access user location using core location frameworks but don't show message to user that "allow to access your location" which ask at staring of application. is there any way to hide this messge of core location frameworks. thanks in advance. ...

Check user location age in Mapkit - GPS accuracy for MapKit User Location significantly better than from CLLocationManager?

Indoors on an iPhone 4. WiFi disabled Running the LocateMe SDK sample or my own code for 30-60 seconds produces horizontal accuracy of 2294 meters. Pretty inaccurate but reasonable for cell tower triangulation. Looking at other apps that do reverse geocoding or location stuff like Foursquare shows a similar lack of accuracy. However, i...

Warning about battery when using Core Location.

I see a lot of apps that use GPS in the iPhone have the following warning in the App Description: Warning: Continued use of GPS running in the background can dramatically decrease battery life. If an App uses the background processes (like startMonitoringSignificantLocationChanges or Region Monitoring) Apple suggested that the battery ...

Receiving CLLocation updates on a background thread

Hi, I am trying to implement a (non-concurrent) NSOperation for location updates using the iPhone SDK. The "meat" of the NSOperation subclass goes something like this: - (void)start { // background thread set up by the NSOperationQueue assert(![NSThread isMainThread]); if ([self isCancelled]) { return; } s...

Accessing iPhone's current location

How can I store the latitude and longitude coordinates of the iPhone's current location into two different float variables? ...

How to re-enable CoreLocation prompt in xcode?

Hi, When I first ran my app that uses CoreLocation in the iPhone simulator, I was prompted with the dialog saying that my app would like to use my current location. In that popup, there is a checkbox that says never ask again. I had that checkbox selected, and now I never receive that popup again. How can I revert this change? I'd l...

startMonitoringForRegion not always adding regions to monitoredRegions.

I can not get startMonitoringForRegion to consistently add regions. int i =0; for(Deals *d in deals){ NSLog(@"deal addRegionsInDealsArray %@",d.deal_id); if (d.latitude != NULL && d.longitude!=NULL && ![d.latitude isEqualToNumber:[NSNumber numberWithInt:0 ]] && !...

MapKit doesn't show Blue Dot for Current Location

Hi Guys, I am a newbie in MapKit for iPhone and tried to implement this, for some reason I can't see the current location blue dot, anyone else had this issue???? #import "DetailMapViewController.h" #import "mapAnnotations.h" @implementation DetailMapViewController @synthesize inStock; -(void)getlocation:(CLLocationCoordinate2D)loc ...