title: Checking Objective-C block type?
body: <p>This is primarily a curiosity, I'm not really sure what's the practical use of this but here goes.</p>
  
  <p>Since blocks are also Objective-C objects, is it possible to check their type?  That is, does it respond to the <code>isKindOfClass:</code> message and how to use that message with respect to blocks?</p>
  
  <p>My naive thought that it's probably like this:</p>
  
  <pre><code>-(void) aMethod {
      typedef int (^BlockA)(int x, int y);
      id blockVar = ...; // get a block from somewhere
      if([blockVar isKindOfClass:BlockA]) {
          BlockA blockVarA = blockVar;
          int result = blockVarA(1,2);
      }
  }
  </code></pre>
  
  <p>The code above probably won't work. But if it <em>is</em> possible to check a block's type, what is the correct way to do it?</p>