cllocationmanager

Can't allocate CLLocationManager

梦想的初衷 提交于 2019-12-25 03:36:09
问题 In my UIViewController's initWithNibNameOrNil , I call: locationManager = [CLLocationManager new]; to create the object, then later in viewDidAppear I call: [locationManager startUpdatingLocation]; [locationManager startUpdatingHeading]; But I never receive a location update; the location manager never starts updating the location. Yet if I replace that same line the initWithNibNameOrNil with: locationManager = [[myAppDelegate appDelegate] locationManager]; everything works great, except for

How to resolve a core location logic in iOS app

元气小坏坏 提交于 2019-12-25 02:38:24
问题 I'm having a problem with the core location logic in my app. The following code is in the rootviewcontroller . It should test to see, if the user has allowed gps/location services on or off for the app and then make a decision and move to one of two view controllers . The app should run this test when it launches. Also if the user goes into the device Settings and changes the Privacy > Location Services > App Name > ON/OFF and relaunches the app then it should go through the process again.

CLLocationManager didUpdateToLocation checking failing

纵然是瞬间 提交于 2019-12-25 01:37:31
问题 I am trying to get the location coordinates using CLLocationManager. Here is my code - (void)viewDidLoad { [super viewDidLoad]; //instantiate location manager and set delegate self.locationManager=[[CLLocationManager alloc]init]; locationManager.delegate=self; // can be set to 100m,1km,3km etc. //locationManager.distanceFilter=10.0f; locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters; //start updating the delegate [locationManager startUpdatingLocation]; } -(void

Continious location updates even if app is terminated in iOS

牧云@^-^@ 提交于 2019-12-25 01:23:19
问题 can anybody help me with getting device location even when the app is terminated. I know how to get location when app is in background. But I am still not able to get it when app is closed/terminated by user. Thanks, Nilesh 回答1: Kindly refer http://mobileoop.com/getting-location-updates-for-ios-7-and-8-when-the-app-is-killedterminatedsuspended I have not tested the same. But you can give a try. 回答2: kindly refer to these pages. it can be done using [[LocationController sharedInstance]

Core Location can't get data in viewDidLoad

自作多情 提交于 2019-12-24 22:33:22
问题 I wrote a simple iOS application that retrieves location information and then uses the location to request Yahoo Weather. The problem is that even when I call the Core Location in the viewDidLoad, it won't give me the result immediately. So why can't I get the location information? How can I get the location information in viewDidLoad? The pseudocode currently is something like: - (void)viewDidLoad { [super viewDidLoad]; self.locManager = [[CLLocationManager alloc] init]; self.locManager

Location services, how to update latitude, Longitude after some time (30 sec)?

。_饼干妹妹 提交于 2019-12-24 21:15:24
问题 I am getting latitude, Longitude, Altitude, Accuracy, Speed from Location services. I want to update all this information every 30 sec. For this purpose I've used a NSTimer: [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(locationUpdate:) userInfo:nil repeats:YES]; which I've put in the viewDidLoad method. It shows an output first time, but the second time, when the timer invokes this, it shows this error: 2011-08-02 13:17:00.141 CoreLocationAssign[1120:207] This is

Self Location Manager Delegate error in Xcode 6

夙愿已清 提交于 2019-12-24 17:00:02
问题 I'm using code from: http://www.veasoftware.com/tutorials/2014/6/17/xcode-5-tutorial-ios-7-simple-compass-app In Xcode 6 I get the error below. The app still runs, but this error is really annoying me. self.locationManager.delegate = self; //Assigning to 'id<CLLocationManagerDelegate>' from incompatible type 'ViewController *const __strong' 回答1: I guess you forgot to comply with the Core Location Delegate protocol by adding <CLLocationManagerDelegate> after @interface in the header file. 回答2:

Update property using Geocoder to get user actual address, EXC_BAD_ACCESS

…衆ロ難τιáo~ 提交于 2019-12-24 14:26:03
问题 Im relatively a new iOS developer, and im dealing with the geocoder completion handler , i do not understand how to update a variable with the address find by the geocoder and the do some stuff with it. In few words, i want that the geocoder block finishes to use the info in some method . - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"didUpdateToLocation: %@", newLocation); CLLocation

How to make my ios app appears in Location Services in the settings

陌路散爱 提交于 2019-12-24 14:16:14
问题 I wrote an CLLocationManager ios app. However, I cannot see my app appears in the Location Services in the settings on my iPhone. Do I need to set a specific value in plist in my ios project in Xcode? Thanks in advance! 回答1: It should appear automatically once code that actually requires location tracking is being called (whenever the popup first show: do you allow...) try calling something like this: [self.locationManager startUpdatingLocation]; And that should do it 回答2: In iOS -8 need to

Why location updates in background mode is slow after iOS 11 update?

北城余情 提交于 2019-12-24 12:14:54
问题 iOS used to wake up my app in background when it was killed, during location updates. After updating to iOS 11, the "wake up" process takes longer (after the user covered a distance of a mile or 2). I haven't seen any new changes to the location manager documentation which relates to this. Any one else experiencing the same issue?? 来源: https://stackoverflow.com/questions/46361459/why-location-updates-in-background-mode-is-slow-after-ios-11-update