title: Monotouch app crashes when attaching events to interface but not with concrete class
body: <p>I have a MonoTouch app which is composed of a number of views, each with an associated interface and presenter. It looks something like this:</p>
  
  <pre><code>class SomeView : UIView, ISomeView
  {
      public event EventHandler PreviousClicked = delegate {};
      public event EventHandler NextClicked = delegate {};
      public event EventHandler Loaded = delegate {};
  
      public SomeView()
      {
          new SomePresenter(this);
      }
  }
  
  interface ISomeView
  {
      event EventHandler PreviousClicked;
      event EventHandler NextClicked;
      event EventHandler Loaded;
      event EventHandler Unloaded;
  }
  
  class SomePresenter
  {
      readonly ISomeView _view;
  
      public SomePresenter(ISomeView view)
      {
          _view = view;
          _view.Loaded += Loaded; 
          _view.NextClicked += NextClicked;
          _view.PreviousClicked += PreviousClicked;
          _view.Unloaded += Unloaded;
      }
  
      void Loaded (object sender, EventArgs e)
      {
          //Nothing special
      }
  
      void PreviousClicked (object sender, EventArgs e)
      {
          //Nothing special
      }
  
      void NextClicked (object sender, EventArgs e)
      {
          //Nothing special
      }
  }
  </code></pre>
  
  <p>This code works perfectly in the simulator however when run on an iPad it will crash when the presenter attaches an event to the view in its constructor. But it crashes in a very very weird way.</p>
  
  <p>Firstly, it does not crash when attaching the first event but rather the second, i.e. </p>
  
  <pre><code>_view = view;
  _view.Loaded += Loaded; 
  _view.NextClicked += NextClicked; //FAILS HERE
  </code></pre>
  
  <p>The stack trace it comes back with is </p>
  
  <pre><code>0   SomeApp              0x008f8e01 mono_handle_native_sigsegv + 244
  1   SomeApp              0x0092b511 sigabrt_signal_handler + 112
  2   libsystem_c.dylib    0x321817ed _sigtramp + 48
  3   libsystem_c.dylib    0x3217720f pthread_kill + 54
  4   libsystem_c.dylib    0x3217029f abort + 94
  5   SomeApp              0x008ceccb monoeg_g_log + 122
  6   SomeApp              0x008d386b get_numerous_trampoline + 134
  7   SomeApp              0x008d3b33 mono_aot_get_imt_thunk + 34
  8   SomeApp              0x00921be5 initialize_imt_slot + 72
  9   SomeApp              0x0092294f build_imt_slots + 642
  10  SomeApp              0x00922a29 mono_vtable_build_imt_slot + 80
  11  SomeApp              0x008fd90d mono_convert_imt_slot_to_vtable_slot + 212
  12  SomeApp              0x008fdab9 common_call_trampoline + 180
  13  SomeApp              0x008fc78b mono_vcall_trampoline + 158
  14  SomeApp              0x005ec748 generic_trampoline_vcall + 136
  ...
  </code></pre>
  
  <p>It should be noted that each of these views is being pushed into a UINavigationController and the presenter can attach events to the view perfectly fine until two views have been pushed onto the stack. </p>
  
  <p>My original assumption was that the GC was aggressively collecting memory but then I tried removing the interface and attaching the events on the concrete type, i.e. </p>
  
  <pre><code>public SomePresenter(SomeView view)
  {
      _view = view;
      _view.Loaded += Loaded; 
      _view.NextClicked += NextClicked; 
      _view.PreviousClicked += PreviousClicked;
      _view.Unloaded += Unloaded;
  }
  </code></pre>
  
  <p>Everything works OK. <em>spooky</em></p>
  
  <p>If anyone has any idea whats going on here, I would be really interested to hear!</p>