title: Implement C# event in Objective-C
body: <p>I want to implement a library for the America's Cup Data Stream API in Objective-C and was looking around if there already existed one and found an <a href="https://github.com/CircuitPeople/Americas-Cup-Data-Lib" rel="nofollow">implementation in C#</a> which I find beautiful and want to borrow some ideas from. This being the first C# source code I've seen so I do not fully understand what is happening. </p>
  
  <p>The following is a sample program that using the C# library. It starts a Client that deal with network communication and a FeedEvents that takes care of the message dispatch. Then something interesting happens, it looks like a lambda expression is being used to specify the action when OnChatterText occurs, right? How do I do this in Objective-C? Using blocks? </p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var c = new Client();
          var e = new FeedEvents();
          e.OnChatterText += ch =&gt; Console.WriteLine(string.Format("{0}: {1}",
              ch.Source, ch.Text));
  
          c.OnMessage += e.MessageHandler;
          c.Connect();
  
          Thread.Sleep(Timeout.Infinite);
      }
  }
  </code></pre>