【发布时间】:2010-09-18 10:17:13
【问题描述】:
您好,我正在制作一个基于 gps 的应用程序...我已经对其进行了测试,并且在 iphone 模拟器 3.0 中运行良好..
但是当 gps 不可用时,我想生成警报...(我只是删除互联网连接) 我使用了以下方法,但没有奏效....
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
NSLog(@"Error: %@", [error description]);
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error getting Current Location" message:@"Please check your Internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alertView show];
[alertView release];
}
所以请告诉我该怎么做 (目前正在使用 iphone 3.0)
还请告诉我是否将此应用程序转移到 iphone 4 是否可以工作...询问因为我听说 iphone 4 有 gps 问题...为此我在模拟器 4.0 上尝试过...但它失败了...
【问题讨论】:
-
核心位置!= GPS。 iOS 设备还有其他方法可以找到它们的位置。您应该查看 Apple 网站上提供的 CoreLocation 的文档、示例代码和视频演示。此外,如果没有细节,在问题中说“失败”几乎是没有用的。
标签: iphone objective-c gps cllocationmanager