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)locationManagerCLLocationManager *)manager
didUpdateToLocationCLLocation *)newLocation
fromLocationCLLocation *)oldLocation
{
NSLog(@"%@", newLocation);
}
the didFinishLaunchWithOptions method looks like this:
- (BOOL)applicationUIApplication *)application
didFinishLaunchingWithOptionsNSDictionary *)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
I am trying to see the location in the console but its not triggering the method
- (void)locationManagerCLLocationManager *)manager
didUpdateToLocationCLLocation *)newLocation
fromLocationCLLocation *)oldLocation
{
NSLog(@"%@", newLocation);
}
the didFinishLaunchWithOptions method looks like this:
- (BOOL)applicationUIApplication *)application
didFinishLaunchingWithOptionsNSDictionary *)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