简体   繁体   English

iPhone CoreLocation框架在带有Simulator 4.1的XCode SDK 3.2.4和带有Simulator 4.0.X的XCode SDK 3.2.3以及带有OS 4.1的iTouch设备上不起作用

[英]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: 实现CLLocationMangerDelegate并使用以下代码:

- (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.)" 错误域= kCLErrorDomain代码= 0“操作无法完成。(kCLErrorDomain错误0。)

I am testing this on a iTouch device with OS 4.1 with WIFI. 我正在具有OS 4.1和WIFI的iTouch设备上对此进行测试。 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. 有没有一种方法可以检测CLLocationManager在设备上是否正常运行。

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 http://www.iphonedevsdk.com/forum/iphone-sdk-development/52267-cllocationmanager-not-getting-drawn-iphone-os-4-0-a.html

Got some hint from Location Manager Error : (KCLErrorDomain error 0) 位置管理器错误中获得了一些提示:(KCLErrorDomain错误0)

Cold be the WiFi or internet problem on the iTouch. 可能是iTouch上的WiFi或互联网问题。 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). 我不明白为什么它不能在模拟器上运行,因为它可以在iPhone模拟器3.1.3上运行,至少默认情况下会显示Infinite Loop,CA(苹果总部地址)。 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? 是否有人使用开发人员支持来询问苹果有关此问题的信息,或使用具有用于模拟器和其他设备的完整CL框架的文档?

Thanks in advance. 提前致谢。

我对它在模拟器中的工作方式的理解是,它将反向对您的wifi连接进行地理编码,而afaik则无法通过触摸获得

You said iTouch device. 您说的是iTouch设备。 I'm assuming you mean iPod Touch device, correct? 我假设您的意思是iPod Touch设备,对吗?

An iPod Touch device does not have a GPS chip, therefore you cannot determine the location via GPS. iPod Touch设备没有GPS芯片,因此无法通过GPS确定位置。

The default location has not been removed for iPhone simulator 3.1.3. iPhone模拟器3.1.3的默认位置尚未删除。 The simulator location code got changed for iOS simulator version 3.2 and above. iOS 3.2及更高版本的模拟器位置代码已更改。

There's one thing you could try though, 您可以尝试做一件事,

Allocate your CLLocationManager is another method that isn't your viewDidLoad: method. 分配CLLocationManager是另一个不是viewDidLoad:方法的方法。 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. 用户需要授予应用程序访问位置的权限,如果将代码放置在viewDidLoad中,则弹出窗口可能不可用:我建议将代码放置在viewDidAppear中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM