cllocationmanager

Update Location in Mapview Xcode

别等时光非礼了梦想. 提交于 2019-12-02 16:17:52
问题 In my current project. I need user's location at every 50 meter user move. So Basically After open application every 50 meter change I need user location for call web service in Objective c . Also i want same process run when application is in background state. Thanks in advance 回答1: set your location track in //create location manager object locationManager = [[CLLocationManager alloc] init]; //there will be a warning from this line of code [locationManager setDelegate:self]; //and we want

Why requestWhenInUseAuthorization doesn't prompt the user for access to the location?

被刻印的时光 ゝ 提交于 2019-12-02 14:04:00
In my viewDidLoad method I have locationManager = [[CLLocationManager alloc]init]; // initializing locationManager locationManager.delegate = self; // we set the delegate of locationManager to self. locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [locationManager requestWhenInUseAuthorization]; } And the request is called, but the user is not prompted? Why? Adrian You probably need to update your plist file. Here's a tutorial how to do it , quick & dirty: You need to do is to

why is my didEnterRegion delegate not called?

隐身守侯 提交于 2019-12-02 13:46:56
问题 I am developing an app that checks for Beacons but I am having issues that my delegate is never run when I enter a region, I know the beacon is ok and broadcasting because I can see it in other beacon apps like "locate beacon" I have configured the same UUID in the transmitter and the receiver app and I have double verified them so I am sure they are the same, below is my code that starts the locationManager and monitors for the region including the delegate. Debugs tells me the monitoring is

MapKit giving wrong lat & lang - iOS 8

旧街凉风 提交于 2019-12-02 13:01:22
When I try to use map in iOS 8, I get below error. Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first. For this I tried solution from here , but still no luck. Below is what I did. Step 1. Have entry in Info.plist NSLocationWhenInUseUsageDescription - This is test text Step 2. Updated -(CLLocationCoordinate2D) getLocation -(CLLocationCoordinate2D) getLocation{ CLLocationManager *locationManager = [[[CLLocationManager alloc] init] autorelease];

Update Location in Mapview Xcode

流过昼夜 提交于 2019-12-02 12:31:01
In my current project. I need user's location at every 50 meter user move. So Basically After open application every 50 meter change I need user location for call web service in Objective c . Also i want same process run when application is in background state. Thanks in advance Anbu.Karthik set your location track in //create location manager object locationManager = [[CLLocationManager alloc] init]; //there will be a warning from this line of code [locationManager setDelegate:self]; //and we want it to be as accurate as possible //regardless of how much time/power it takes [locationManager

iOS LocationManager is not updating location (Titanium Appcelerator module)

蓝咒 提交于 2019-12-02 10:28:41
I've made Appcelerator Titanium Module for fetching device's rotaion and location. Source can be found on GitHub . The problem is that it fetches only one cached location but device motion data is OK and it is refreshing. I don't use delegate, I pull that data in my Titanium Javascript Code. If I set "City Run" in Simulator -> Debug -> Location nothing happens. The same cached location is returning. Pulling of location is OK because I tried with native app wich does this: textView.text = [NSString stringWithFormat:@"%f %f\n%@", locationManager.location.coordinate.longitude, locationManager

Calculating Cumulative elevation gain give me wierd results

二次信任 提交于 2019-12-02 09:52:43
I have the app that use CoreLocation and track user movement. When user is walking or driving I save each coordinate to local database (lat/lng/alt) so I can draw route based on saved coordinates. A few days ago I have added Cumulative elevation gain and I use this code in didLocationUpdate: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { netElevationGain += MAX(0, oldLocation.altitude - newLocation.altitude); } But something is just wrong. I started the application and start walking and walking around

Does the internal GPS antenas stop working immediately after calling CLLocationManager stopUpdatingLocation

半世苍凉 提交于 2019-12-02 09:45:19
Here is my scenario. In my app there is no need of continuously monitoring user location, but I need the location to be as accurate as possible. So I just call CLLocationManager startUpdatingLocation with kCLLocationAccuracyBestForNavigation set as desiredAccuracy, and after I get the location with my desired accuracy (by comparing newLocation.horizontalAccuracy with predefined value) I want to stop the location update and revoke update again after several seconds. But when I call stopUpdatingLocation the location icon from status bar disappears after about 10 seconds, does this mean that

Why does CLLocationManager returns null locations on the iphone SDK 4 beta in the Simulator?

六眼飞鱼酱① 提交于 2019-12-02 08:13:01
I have this piece of code: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"Manager did update location!!"); self.currentLocation = newLocation.description; } I have this code inside a class that conforms to the CLLocationManagerDelegate . I tested earlier in sdk 3.0 and works nice (on both simulator and device). I'm testing this class on the SDK 4, in the simulator, but it gives null as a newLocation. I can't even get the NSLog for the first call. I checked other app where I use the location

How to get user location?

梦想的初衷 提交于 2019-12-02 07:11:55
问题 I am trying to get the user's current location using the following code, but it doesn't work. I have added both NSLocationWhenInUseUsageDescription key and NSLocationAlwaysUsageDescription key to my Info.plist file. Below is the code var locationManager = CLLocationManager(); override func viewDidLoad() { super.viewDidLoad() startReceivingLocationChanges(); } func startReceivingLocationChanges() { let authorizationStatus = CLLocationManager.authorizationStatus() if authorizationStatus !=