title: Apple Health Kit Error Domain=com.apple.healthkit Code=5 "Authorization not determined"
body: <p>I have determined authorization before actually trying to save any data or do anything with it. The error is happening at the moment of query: </p>
  
  <pre><code>HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:foodType 
  predicate:predicate 
  limit:HKObjectQueryNoLimit 
  sortDescriptors:nil 
  resultsHandler:^(HKSampleQuery *query, NSArray *results, NSError *error){ ... }
  </code></pre>
  
  <p>Yes, I have read apple documentation that says:</p>
  
  <blockquote>
    <p>Attempts to save data before permission has been requested fail with a
    HKErrorAuthorizationNotDetermined error.</p>
  </blockquote>
  
  <p>But I do request permissions before I try to ask for data (I see the list with all data types (in the code - dataTypesToRead / Write)).
  Did anybody have this type of issue?</p>