【问题标题】:How to detect "would like to use your current location" choose action?如何检测“想使用您当前的位置”选择动作?
【发布时间】:2013-04-18 03:58:53
【问题描述】:

据我们所知,CLLocationManager 可用于在警报许可的情况下获取当前位置:“MyAppName”想要使用您当前的位置”|“不允许”|“允许”。我们怎么能在用户选择“不允许”或“允许”后检测到选择操作?任何帮助将不胜感激!

【问题讨论】:

    标签: iphone ios gps cllocationmanager


    【解决方案1】:
    -(void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:   (CLAuthorizationStatus)status {
    
        if (status == kCLAuthorizationStatusDenied) {
            // Don't Allow
        }
        else if (status == kCLAuthorizationStatusAuthorized) {
            //Allow
        }
    }
    

    实现CLLocationManagerDelegate并使用此委托方法

    【讨论】:

    • cmets 对我来说似乎倒退了
    猜你喜欢
    • 2022-01-15
    • 1970-01-01
    • 2015-11-08
    • 1970-01-01
    • 1970-01-01
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多