i try to update the user current location, my relevant code is this :
#pragma mark-
#pragma mark CLLocationManagerDelegate
-(void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
float latitude=newLocation.coordinate.latitude;
float longitude=newLocation.coordinate.longitude;
TopStationAppDelegate *topStation=(TopStationAppDelegate *)[[UIApplication sharedApplication]delegate];
topStation.latitudeUtilisateur=latitude;
topStation.longitudeUtilisateur=longitude;
NSLog(@"%f",latitude);
NSLog(@"%f",longitude);
NSLog(@"position updated");
//[locationManager stopUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"didFailWithError: %@", error);
}
the didFailWithError method return me this stack:
ERROR,Time,332840118.515,Function,"void CLClientHandleDaemonDataRegistration(__CLClient*, mach_port_t, const CLDaemonCommToClientRegistration*, const __CFDictionary*)",server did not accept client registration 2
2011-07-20 09:35:18.525 TopStation[764:207] didFailWithError: Error Domain=kCLErrorDomain Code=1 "The operation couldn’t be completed. (kCLErrorDomain error 1.)"
Can you please help me there? thanx in advance 🙂
As the previous comment stated, the simulator version you are working with just won’t work for location based stuff. Your best bet (if you are a paid developer) is to download the new Xcode 4.2 that does allow you to manipulate location data and actually use the simulator.
If you aren’t a paid developer, you will have to test on device.
Check this post here for some links if you are a paid dev. You can check out the WWDC videos on how to use the simulator for location testing.