iOS4定位问题

发布于 2024-09-29 11:18:21 字数 182 浏览 0 评论 0原文

我在我的应用程序中使用位置并使用 IOS 3 模拟器对其进行了测试,它在它可以工作的设备上也可以正常工作。 但当在 IOS4 模拟器上测试时它崩溃了..并且无法找到位置 我知道模拟器上的位置是无限循环加利福尼亚州库比蒂诺。 但它在 IOS4 中不起作用...

而且我没有 Iphone4...所以无法进一步测试

请帮忙

i am using location in my app and tested it with IOS 3 simulatior it works fine also on device it works fie.
but when tested it on IOS4 simulator it crashes..and unable to find location
I know that the location on simulator is of infinite loop cupertino california.
but it is not working in IOS4...

and i don't have Iphone4...So can't test further

please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤蝉 2024-10-06 11:18:21

也许模拟器无法检索默认的 CLLocationManager 位置。
你可以试试这个:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    location = newLocation.coordinate;

// Manually setting a default location for simulator only
    if(TARGET_IPHONE_SIMULATOR){
    location.latitude= 45.00;
    location.longitude= 45.00;
    }
}

Maybe the simulator can't retrieve the default CLLocationManager location.
You can try this:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    location = newLocation.coordinate;

// Manually setting a default location for simulator only
    if(TARGET_IPHONE_SIMULATOR){
    location.latitude= 45.00;
    location.longitude= 45.00;
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文