title: Use an ObjC Block as a callback for CGDataProviderCreateWithData
body: <p>We want to call <code>CGDataProviderCreateWithData()</code> with the <code>releaseData</code> callback defined right in the arguments list. How can we do it?</p>
  
  <p>I've tried a bunch of options, but was unable to crack the block syntax for this case.</p>
  
  <p>The following:</p>
  
  <pre><code>const CGDataProviderRef provider = CGDataProviderCreateWithData(
      NULL,
      outputPixelDataBytes,
      pixelsSize,
      ^void(void * __nullable info, const void * data, size_t size) {
          free(data);
      });
  </code></pre>
  
  <p>doesn't compile with the error:</p>
  
  <blockquote>
    <p>Passing 'void (^)(void * _Nullable, const void <em>, size_t)' to
    parameter of incompatible type 'CGDataProviderReleaseDataCallback
    _Nullable' (aka 'void (</em>)(void * _Nullable, const void * _Nonnull, unsigned long)')</p>
  </blockquote>
  
  <p>Not sure what to change to get rid of the error.</p>