Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RMK-Jacob

macrumors newbie
Original poster
Mar 24, 2012
10
0
Hi,

So I am using CLLocation and CLLocation manager and the method locationManager:didUpdateToLocation:fromLocation isn't running. In my viewDidLoad I placed the following:
Code:
theLocation = [[CLLocationManager alloc] init];
[theLocation setDelegate: self];
[theLocation setDesiredAccuracy:kCLLocationAccuracyBest];
theLocation.distanceFilter = kCLDistanceFilterNone;
[theLocation startUpdatingLocation];

In the locationManager:didUpdateToLocation:fromLocation i placed a NSLog. The info that I put into the NSLog isn't showing up in the debugger, so I know that the
locationManager:didUpdateToLocation:fromLocation method isn't even running.

Please try to help me and tell me what I should do to fix.

UPDATE: The problem seems to be that the locationManager:didUpdateToLocation:fromLocation method is returning (null).

Thanks,
RMK-JACOB
 
Last edited:
Both. I tried on device: doesn't work... I tried on simulator: doesn't work
 
Did you deny the app access:

"The user has the option of denying an application’s access to the location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManager object reports an appropriate error to its delegate during future requests."
 
Nope. I granted access. The method locationManager:didUpdateToLocation:fromLocation is returning a (null) value for no reason.
 
Nope. I granted access. The method locationManager:didUpdateToLocation:fromLocation is returning a (null) value for no reason.

Post your code. The complete code of the whole method, not separate isolated lines.


Isolated lines

have
no context
It's not

even clear

Code:
if
they're in
the same method.
 
Hi,

So I am using CLLocation and CLLocation manager and the method locationManager:didUpdateToLocation:fromLocation isn't running. In my viewDidLoad I placed the following:
Code:
theLocation = [[CLLocationManager alloc] init];
[theLocation setDelegate: self];
[theLocation setDesiredAccuracy:kCLLocationAccuracyBest];
theLocation.distanceFilter = kCLDistanceFilterNone;
[theLocation startUpdatingLocation];

In the locationManager:didUpdateToLocation:fromLocation i placed a NSLog. The info that I put into the NSLog isn't showing up in the debugger, so I know that the
locationManager:didUpdateToLocation:fromLocation method isn't even running.

Please try to help me and tell me what I should do to fix.

UPDATE: The problem seems to be that the locationManager:didUpdateToLocation:fromLocation method is returning (null).

Thanks,
RMK-JACOB


You said:

UPDATE: The problem seems to be that the locationManager:didUpdateToLocation:fromLocation method is returning (null).

That method is a void method. It doesn't return anything. You mean one or more of the values passed into that method are null?

As the other posters said, post the full code for your locationManager:didUpdateToLocation:fromLocation: method.
 
The didUpdateToLocation:(CLLocation*)newLocation. The newLocation variable is null. Sorry for not specifying what was wrong.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.