-1

我想在打开应用程序时显示位置权限对话框(稍后我会检索实际位置)。我可以通过执行以下操作来假装检索位置:

    if(firstApplicationLaunch){
       firstApplicationLaunch = NO;
       locationManager = [[CLLocationManager alloc] init];
       [locationManager startUpdatingLocation];
       [locationManager stopUpdatingLocation];
    }
4

1 回答 1

1

是的,这将在启动时强制位置权限对话框。但是,您需要注意CLLocationManager在用户响应对话框之前不要释放或让它超出范围,否则对话框将消失。

于 2013-10-16T17:06:50.130 回答