Checking Location Service in iOS

- (void)checkingLocationService
{
  switch([CLLocationManager authorizationStatus]) {
    case kCLAuthorizationStatusNotDetermined:
      // User has not yet made a choice with regards to this application
      break;
    case kCLAuthorizationStatusRestricted:
      // This application is not authorized to use location services.  Due
      // to active restrictions on location services, the user cannot change
      // this status, and may not have personally denied authorization
      //break;
    case kCLAuthorizationStatusDenied:
    {
      // User has explicitly denied authorization for this application, or
      // location services are disabled in Settings
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Privacy Warning" message:@"Permission was not granted for Location"
                                                     delegate:nil
                                            cancelButtonTitle:@"OK"
                                            otherButtonTitles:nil];
      [alert show];
    }
      break;
    case kCLAuthorizationStatusAuthorized:
      // User has authorized this application to use location services
      break;
  }
}