core-location

Core Location Manager Prompt/Alert problem

I have come across an interesting problem which I am unable to debug. My application is using core location services and works fine in both the simulator and on the device once location services are enabled. I have tested it by manually toggling the permission in the settings pane. However for some reason when the user has not set any...

Is it possible to run a task periodically in Background - iOS 4

Hi, I want to poll the location from GPS in the background. So we used a NSTimer and performed periodic checks in the timer tick. In other words, can we schedule NSTimer while the app is in Background? Thanks in advance ...

iPhone Core Location: DIfferentiate pin for custom pin image.

I am using - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ to draw my own image for a custom pin. I would like to use a different image for different pins. I was wondering how I could differentiate which pin was calling this function. EDIT: annView.annotation.title did the trick. ...

iPhone Core Location: Custom pin image disappears when map type changes.

I have a segmented controller which sits on a MKMapView. When I change MKMapType, the image of my custom pins revert to the default red. The title and subtitle, along with coordinates remain intact. Can anyone shed some light on a possible solution? ...

Is there any performance penalty for using multiple CLLocationManager instances

I have at least two controllers in my app that currently use their own CLLocationManager instance. I'm curious however if using multiple instances actually imposes any additional burden on the phone - beyond the additional memory for the different instances. Will the iPhone ping the GPS hardware multiple times, or does it use some sort...

distanceFromLocation - getting error

Hello, I have the following code in place: NewWorkoutViewController.h #import <UIKit/UIKit.h> //#import <CoreLocation/CoreLocation.h> #import <CoreData/CoreData.h> #import "MapViewController.h" #import "StatisticsViewController.h" #import "MyCLController.h" #import "Workout.h" #import "Route.h" @interface NewWorkoutViewController : ...

How to calibrate altitude depending on position above sea level?

I'm building a simple altimeter app and I want to be able to calibrate the altitude depending on where I am located above sea level. So at the moment I am at 300m but I want to be able calibrate that so it says 0m, and make my location "sea level". How would I implement the calibration? MainView.h import import import @inter...

how to trap the location alert response iphone

Hii, I am using GPS in iphone and it show conformation message for use location service. and i want to trap what user select "Allow" or "No". can any one suggest how i do this? Thank ...

how to trap the location alert response iphone

Hii, I am using GPS in iphone and it show conformation message for use location service. and i want to trap what user select "Allow" or "No". can any one suggest how i do this? Thank ...

MKAnnotation: Reading a tag for MKAnnotation.

When I add an annotation, I add a ".tag" to it. However I can never read the tag in the following method. `- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation` MKAnnotationView *annView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"MyPin"]; annView....

CoreLocation crashes on device but not on simulator

Keep getting EXC_BAD_ACCESS. Ran NSZombieEnabled and came up with nothing. In simulator console: 2010-09-11 23:39:56.876 [19072:207] 1.309789, lat, 103.772196, lon In device console: EXC_BAD_ACCESS The line of code: NSLog(@"%f, lat, %f, lon",latitudeString,longitudeString); What CLManager is doing: - (void)locationManager:(C...

Can't obtain location data, unless it's direct GPS Fix

Starting this morning my application can not obtain CLLocation data unless direct GPS Fix established. I received few dozen complaints from SouthEast Asia and all my US customers are out of luck since the midnight. I noticed that Echophone and Zillow apps are malfunctioning too. Apple's own Maps.app does not check CLLocation's timestamp ...

How to implement an odometer on an iPhone

I'm working on a fairly simplistic trip application for the iPhone for use when running, biking, etc. One of the features I'd like to implement is an odometer. I'm getting the location periodically via didUpdateToLocation. I've tried measuring the distance between newLocation and oldLocation and accumulating the result, but this is no...

Is kCLErrorNetwork a "fatal" error for Core Location?

Is kCLErrorNetwork "fatal", i.e. can location still be acquired or should we tell Core Location to stop updating the location? In iOS 3.0, Core Location added an error code, kCLErrorNetwork. It is described as a "general, network-related error". Does this mean that neither the cell network nor Wi-Fi is available and Core Location can on...

Core Location + allow to use your current Location??

In my application corelocation manager updates the current location more than once by calling "startUpdatingLocation" method. When i run the application on device it behaves differently on different devices. On iPod touch with iOS 3.0 it asks "Application would like to use your current location" every time i call [locationManager start...

Is it possible to call alert "Allow to use current location" manually?

Is it possible to call alert "Allow to use current location" manually when using CoreLocation framework? ...

"An error has occurred" message when Location Services is turned off.

In the iOS simulator, I am prompted to turn on my location when the app attempts to pinpoint my location. However, on an iphone running 4.1, I get a generic "An error has occurred" without any type of prompt. I checked my project's NSLogs/Alerts and none of them have a generic "An error has occurred." Is anyone aware of why this happens?...

CLLocation manager throws after ~30seconds

@ first I thought it wasn't firing, but saw this So I waited and now I get Unhandled Exception: MonoTouch.Foundation.You_Should_Not_Call_base_In_This_Method: Exception of type 'MonoTouch.Foundation.You_Should_Not_Call_base_In_This_Method' was thrown. in the failed handler. I have defined a CLLocationManager, here is FinishedLaunching &...

Region Monitoring - didEnterRegion

I want to check whether iphone is in a particular region and the region coordinates I am getting from web.On web region is a polygon, but as CLregion has only one fuction i.e. initCircularRegion, how can i convert that points of polygon region to get a circular region for which I can do monitoring, or is there any other method by which ...

Calculating bearing between two CLLocationCoordinate2Ds

Very "simple" problem: given two CLLocationCoordinate2Ds, how can I get the bearing (as radians) from the first to the second? I've done a lot of research and studying on this, both the general problem and Objective-C/Cocoa Touch/iOS specifically. Here's my implementation: - (float) getHeadingForDirectionFromCoordinate:(CLLocationCoord...