title: EXC_BAD_ACCESS when copying or retaining Block
body: <p>As far as I understand a Block acts like an object, in that you can send copy or release messages to it, e.g:</p>
  
  <pre><code>[myBlock copy];
  </code></pre>
  
  <p>However whenever I do this, or release a block, I get EXC_BAD_ACCESS.</p>
  
  <p>If I use the block functions, everything works as expected, e.g.:</p>
  
  <pre><code>Block_copy(myBlock);
  </code></pre>
  
  <p>I thought both ways of releasing and copying blocks were identical?</p>
  
  <p>It's not that much of a problem, but it is a little annoying that if I have a property (copy) which is a Block, I have to write the setter method myself.</p>
  
  <p>For example: With Properties:</p>
  
  <pre><code>//Header
  @property (nonatomic, copy) void (^cancelledBlock)(void);
  
  //Implementation
  @sythesize cancelledBlock;
  </code></pre>
  
  <p>leads to EXC_BAD_ACCESS when setting <code>cancelledBlock</code></p>
  
  <p>but if I do:</p>
  
  <pre><code>//Header
  @property (nonatomic, copy) void (^cancelledBlock)(void);
  
  //Implementation
  @sythesize cancelledBlock; //saves me doing the getter as well
  
  - (void)setCancelledBlock:(void (^)(void))aCancelledBlock {
      if (cancelledBlock == aCancelledBlock) {
          return;
      }
      void (^oldValue)(void) = cancelledBlock;
      cancelledBlock = Block_copy(aCancelledBlock);
      Block_release(oldValue);
  
  }
  </code></pre>
  
  <p>there is no EXC_BAD_ACCESS and everything runs as it should.</p>