title: how do I detect location service disable for my app?
body: <p>IOS4 has recently introduced the possibility to <strong>enable/disable</strong> location services for a <em>specific</em> application.</p>
  
  <p>I need to detect if this settings is <strong>enabled/disabled</strong> for MY application.</p>
  
  <p><strong>First</strong> I have tried with:</p>
  
  <pre><code>if ([CLLocationManager locationServicesEnabled])
      {
         ....
      } 
  </code></pre>
  
  <p>however this refers to the global location service and not to the specific application setting.</p>
  
  <p><strong>Second</strong> I have tried to use</p>
  
  <pre><code>- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
  {
     ...
  } 
  </code></pre>
  
  <p><strong>It works</strong> but it gets called both in case of service app setting disabled and in other cases like, for example, if a measure fails for some reasons.</p>
  
  <p><strong>I need a code to detect if MY application is allowed to use location services.</strong></p>
  
  <p><strong>How can i achieve this?</strong></p>
  
  <p>Thanks for your support</p>