title: How to pass a objective-c method to c function as callback?
body: <p>I've already read several articles about this question, but none of them solve my problem.</p>
  
  <p>Briefly, in my NSApplicationDelegate, I called a function <code>pcap_loop</code>, <code>pcap_loop</code> needs a function pointer as callback, the callback signature is</p>
  
  <p><code>void got_packet(u_char *, const struct pcap_pkthdr *, const u_char *)</code></p>
  
  <p>I want to pass one of the NSApplicationDelegate's method as callback, so I can use these data in my app, somebody suggest me using "SEL + IMP", but I can't pass the <code>self</code> to callback, also somebody suggest "block", not work.</p>
  
  <p>So, any idea?</p>
  
  <p>Thanks!</p>