title: gomobile: binding callbacks for ObjC
body: <p>I have a Go interface</p>
  
  <pre><code>type GetResponse interface { OnResult(json string) }
  </code></pre>
  
  <p>I have to subscribe on that event OnResult from ObjC using this interface.</p>
  
  <pre><code>func Subscribe( response GetResponse){ response.OnResult("some json") }
  </code></pre>
  
  <p>ObjC bind gives me a corresponding protocol and a basic class</p>
  
  <pre><code>@interface GetResponse : NSObject &lt;goSeqRefInterface, GetResponse&gt; {
  }
  @property(strong, readonly) id _ref;
  
  - (instancetype)initWithRef:(id)ref;
  - (void)onResult:(NSString*)json;
  @end
  </code></pre>
  
  <p>So, I need to get this json in my ObjC env. How can I do that?</p>
  
  <ol>
  <li><strong>Subclassing</strong> If I subclass this GetResponse or just use it as is and pass to     Subscribe routine, it crashes
  <strong>'go_seq_go_to_refnum on objective-c objects is not permitted'</strong></li>
  <li><p><strong>Category</strong> if I create struct on Go side with the protocol support, I can't subclass it but at least it's not crashes:</p>
  
  <pre><code>type GetResponseStruct struct{}
  func (GetResponseStruct) OnResult(json string){log.Info("GO RESULT")}
  func CreateGetResponse() *GetResponseStruct{ return &amp;GetResponseStruct{}}
  </code></pre>
  
  <p>I have a solid object without obvious way to hook up my callback. If I make a category and override the onResult routine, it's not called. Just because overriding existing methods of class is not determined behavior according to AppleDoc. Anytime OnResult called from Go, the default implementation invokes and "GO RESULT" appears.</p></li>
  <li><p><strong>Swizzling</strong> I tried to use category and swizzle (replace method's implementation with mine renamed method) but it only works if I call onResult from ObjC env.</p></li>
  </ol>
  
  <p>Any way to solve my issue? Or I just red the doc not very accurately? Please help me</p>