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:

RMK-Jacob

macrumors newbie
Original poster
Mar 24, 2012
10
0
Both. I tried on device: doesn't work... I tried on simulator: doesn't work
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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."
 

RMK-Jacob

macrumors newbie
Original poster
Mar 24, 2012
10
0
Nope. I granted access. The method locationManager:didUpdateToLocation:fromLocation is returning a (null) value for no reason.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,760
8,452
A sea of green
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.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
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.
 

RMK-Jacob

macrumors newbie
Original poster
Mar 24, 2012
10
0
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.