iPhone:核心位置弹出问题 [英] iPhone:Core Location popup issue

查看:84
本文介绍了iPhone:核心位置弹出问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在iPhone中安装我的应用并首次运行时,它会向用户请求核心位置服务的许可。这是模拟器的图像。

When I install my app in iphone and run first time then it ask user permission for core location service. Here is the image for simulator.

在我的应用程序中,应用程序的第一个视图需要当前位置,并根据位置列出一些事件。如果应用程序无法获取位置,它将显示默认事件列表。

In my app, my first view of application needs current location and based on location it lists some events. If application couldn't get location it shows the default list of events.

所以,我想知道是否有可能保持应用程序流,直到用户单击 不允许确定按钮?

我知道用户是否单击不允许,然后 kCLErrorDenied 错误将被触发。

So, I would like to know that Is it possible to hold the application flow until user click on either " Don't allow" or "ok " button ?
I know if user clicks on "Don't allow" then kCLErrorDenied error will get fired.

当前发生的情况是,如果用户未单击任何按钮,则应用程序将显示带有默认列表的列表页面(没有位置)。然后,如果用户单击 确定按钮,则什么也不会发生!单击按钮后,如何刷新页面?

Currently what happens, if user does not click on any of buttons, application displays listing page with default list (without location). And after that if user clicks on "ok " button then nothing happens !!! How can I refresh the page upon "ok" button click ?

谢谢…。

推荐答案

是的,只是不执行任何操作,直到调用了这些委托方法。当他们单击确定时,这只是Cocoa发出的信号,然后尝试检索用户的位置-您应该对应用程序进行结构设计,以便在CLLocationManager具有位置或无法获取位置时,您的应用程序将继续。

Yes, just don't do anything until those delegate methods are invoked. When they click 'OK', that's just a signal for Cocoa to go and then try to retrieve the user's location - you should structure your app so that when the CLLocationManager has a location or can't get one, your app then continues.

在位置返回/失败之前,您不想说暂停您的应用;那不是面向对象的开发。

You wouldn't want to say, pause your app until the location returns/fails; that's not what object oriented development is about.

这篇关于iPhone:核心位置弹出问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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