开发者

iPhone CoreLocation framework not working on XCode SDK 3.2.4 with Simulator 4.1 and XCode SDK 3.2.3 with Simulator 4.0.X and iTouch device with OS 4.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 开发者_如何学JAVAerror 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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜