I don’t get GPS location updates. I’m using an iPad2 to run the code. This is my code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//location
locationManager = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
NSLog(@"locationManager startUpdatingLocation"); //this core runs correctly
...
}
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
{
NSLog(@"Error: %@", [error description]);
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
location = [newLocation description];
NSLog(@"new location: %@", location); //never printed
}
Should I allow location in the preferences ? I was expecting the iPad asking permissions for to share the location but I didn’t get any.
thanks
I’ve actually removed autorelease and added release in dealloc, and that’s it.