デリゲートで CLLocationManager を使用して場所を取得します。失敗した場合は、エラー コードをチェックして、ユーザーがアプリで位置情報へのアクセスを拒否していないかどうかを確認します。
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
UIAlertView *alert;
//denied?
if(error.code == kCLErrorDenied) alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",@"Error title header") message:NSLocalizedString(@"Turn on Location Services in Settings to use your location",@"Turn on Location Services in Settings to use your location") delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
else alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",@"Error title header") message:NSLocalizedString(@"At the moment it is not possible to retreive your location",@"At the moment it is not possible to retreive your location") delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}