Ios8 请求使用中授权不会显示任何提示

Ios8 请求使用中授权不会显示任何提示,ios8,core-location,Ios8,Core Location,我有 及 在my Info.plist中定义 在我的代码中,我是这样做的 NSLocationAlwaysUsageDescription 我没有在iOS8上得到提示 我在我的模拟器中重新安装了一个干净的程序。在没有3if块的iOS7上,我会得到提示 启动后立即检查[CLLocationManager授权状态],该状态为0-KClauthorizationStatus未确定 如何提示iOS8用户?4 ios 8:需要在info.plist中配置它 密钥名称为NSLocationAlways使用

我有

在my Info.plist中定义

在我的代码中,我是这样做的

NSLocationAlwaysUsageDescription
我没有在iOS8上得到提示

我在我的模拟器中重新安装了一个干净的程序。在没有3if块的iOS7上,我会得到提示

启动后立即检查[CLLocationManager授权状态],该状态为0-KClauthorizationStatus未确定


如何提示iOS8用户?

4 ios 8:需要在info.plist中配置它

密钥名称为NSLocationAlways使用描述值为

密钥名称为NSLocationWhenUsageDescription值为

当你打电话时:

    if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
        [_locationManager requestWhenInUseAuthorization];
    }

    [_locationManager startUpdatingLocation];
将自动提示

使用模拟器进行测试,您可以单击重置内容和设置。。。并再次提示

下面是一个演示:

    if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
        [_locationManager requestWhenInUseAuthorization];
    }

    [_locationManager startUpdatingLocation];
[_locationManager requestWhenInUseAuthorization];