在我的應用程序可能重複:
Is it possible to call alert 「Allow to use current location」 manually?彈出「應用程序想用你的當前位置」對話再次
,所有的功能是基於用戶當前位置。觀衆是一切都比怪異。
我認爲用戶首先啓動應用程序 - 因爲用戶不確定它可以做什麼,他/她可能會對應用程序的「想要使用當前位置?」感到困惑。如果他回答「不允許」,他不會在屏幕上獲得任何數據。
現在我處理:
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error {
if (error.code == kCLErrorDenied) {
NSLog(@"Location manager denied access - kCLErrorDenied");
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"Location issue"
message:@"Your location cannot be determined."
delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
}
好了,該應用程序有一個刷新鍵式。假設用戶點擊重新加載按鈕,他不會再被系統詢問以啓用基於位置的服務。
我該如何強制iOS再次詢問當前位置?
我也想知道如何做到這一點完全相同的原因。 –
也http://stackoverflow.com/q/4891950/10396 – AShelly