Issue getting didUpdateToLocation in CLLocationManager to trigger

Joined
Aug 23, 2011
Messages
8
Reaction score
0
Points
1
I have a basic app from Whereami (iOS Programming by J Conway & Hillegass)

I am trying to see the location in the console but its not triggering the method


- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"%@", newLocation);
}


the didFinishLaunchWithOptions method looks like this:

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[locationManager = [[CLLocationManager alloc] init];

[locationManager setDelegate:self];

[locationManager setDistanceFilter:kCLDistanceFilterNone];

[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];

[locationManager startUpdatingLocation];

self.window.backgroundColor = [UIColor blueColor];


_rootViewController = [[UIViewController alloc] init];
self.window.rootViewController = self.rootViewController;


[[self window] makeKeyAndVisible];
return YES;
}


Can anyone tell me please why the didUpdateToLocation method doesn't get called? I have a breakpoint in it and it doesn't go in there.

Thank you
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top