title: Using OCMock to expect category methods yields "[NSProxy doesNotRecognizeSelector"...]"
body: <p>I'm using <a href="http://www.mulle-kybernetik.com/software/OCMock/" rel="nofollow noreferrer">OCMock</a> trying to test the behavior of NSURLConnection. Here's the incomplete test:</p>
  
  <pre><code>#include "GTMSenTestCase.h"
  #import &lt;OCMock/OCMock.h&gt;
  
  @interface HttpTest : GTMTestCase
  
  - (void)testShouldConnect;
  
  @end
  
  @implementation HttpTest
  
  - (void)testShouldConnect {
    id mock = [OCMockObject mockForClass:[NSURLConnection class]];
  
    NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:mock startImmediately:NO];
  
    [[mock expect] connection:connection didReceiveResponse:OCMOCK_ANY];
  }
  
  @end
  </code></pre>
  
  <p>When mocking a class with category methods, which the delegate method <em>connection:didReceiveresponse:</em> is, I get the error:</p>
  
  <pre><code>Unknown.m:0:0 Unknown.m:0: error: -[HttpTest testShouldConnect] : *** -[NSProxy doesNotRecognizeSelector:connection:didReceiveResponse:] called!
  </code></pre>
  
  <p>Has anyone had a problem with this?</p>