在iPhone模拟器中禁用位置服务? [英] Disable location service in iPhone simulator?

查看:149
本文介绍了在iPhone模拟器中禁用位置服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试如果我的应用无法获取位置坐标会发生什么。是否可以在模拟器中禁用位置服务,例如关闭WiFI的iPod Touch?

I'd like to test what happens if my app can't get the location coordinates. Is it possible to disable the location service in the simulator, like on an iPod Touch with WiFI turned off?

我仍然没有我的iPhone开发者计划证书,所以我无法在我的设备上测试它。

I still don't have my iPhone Developer Program certificate, so I can't test it on my device.

提前致谢!

推荐答案

作为一种解决方法,您可以尝试通过使用适当的值构造NSError对象并手动调用相应的CLLocationManager委托 didFailWithError:方法来模拟更新位置失败。

As a workaround you can try to simulate update location failure by constructing NSError object with appropriate values and calling corresponding CLLocationManager delegate didFailWithError: method manually.

这篇关于在iPhone模拟器中禁用位置服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆