title: iOS: Posting code blocks within userInfo using NSNotificationCenter?
body: <p>Can i safely post messages containing code blocks within my program address space? Tests works but is this legal?  </p>
  
  <pre><code>typedef void (^EmitBlock)(NSDictionary* args);
  
  
  - (void) subscribe {
      [[NSNotificationCenter defaultCenter] addObserver:self
          selector:@selector(on_emit:) name:kEmit object:nil];
  }
  
  
  - (void) on_emit:(NSNotification*) notification
  {
      EmitBlock completion = [[notification userInfo] valueForKey:@"completion"];
      completion(@{@"result" : @"Ok"});
  }
  
  
  - (void) post:(EmitBlock) completion {
      [[NSNotificationCenter defaultCenter] postNotificationName:kEmit
          object:nil userInfo:@{@"completion":
              ^(NSDictionay* args) { NSLog(@"%@", args); }
      }];
  }
  </code></pre>