1

Facing serious problem.

Implementing CLLocationMangerDelegate and using this code:

- (void)locationManager:(CLLocationManager *)manager  didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation  

but method

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
 NSLog(@"%@",[error description]);
}

When it fires I get:

Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)"

I am testing this on a iTouch device with OS 4.1 with WIFI. Which also gives the same error in the console as mentioned above.

Has anyone faced this scenario or can anyone can help me out wiht this problem. Is there a way to detect CLLocationManager is functional on the device or not.

I have found some similar discussions on this link, but no solutions yet!

http://www.iphonedevsdk.com/forum/iphone-sdk-development/52267-cllocationmanager-not-getting-called-iphone-os-4-0-a.html

Got some hint from Location Manager Error : (KCLErrorDomain error 0)

Cold be the WiFi or internet problem on the iTouch. I cannot understand why it is not working on the simulator as it would work with iPhone simulator 3.1.3, at least by default it would show Infinite Loop,CA (Apple head office address). Could it be that this default address is completely removed?

Anyone used developers support to ask apple about this issue or a document with the complete CL framework for simulator and other devices?

Thanks in advance.

Community
  • 1
  • 1
Ameya
  • 1,914
  • 4
  • 29
  • 55
  • Can you show where you are allocating and instantiating the `CLLocationManager`? – Don Oct 01 '10 at 18:59
  • I am instantiating the CLLocationManger in the -(void)viewDidLoad .. method CLLocationManager *locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters]; [locationManager startUpdatingLocation]; – Ameya Oct 01 '10 at 19:07

2 Answers2

0

My understanding of how it works in the simulator is that it reverse geocodes your wifi connection, and afaik that's not available through the touch

0

You said iTouch device. I'm assuming you mean iPod Touch device, correct?

An iPod Touch device does not have a GPS chip, therefore you cannot determine the location via GPS.

The default location has not been removed for iPhone simulator 3.1.3. The simulator location code got changed for iOS simulator version 3.2 and above.

There's one thing you could try though,

Allocate your CLLocationManager is another method that isn't your viewDidLoad: method. The user needs to give the application permission to get the location, and the pop up may not become available if you place the code in viewDidLoad: I recommend placing the code in viewDidAppear.

Louis Cremen
  • 764
  • 7
  • 12