title: Protocol as method argument
body: <p>I want a method to have access to a subset of method declared in a single class. Obviously this can be achieved by protocols.</p>
  
  <p>The method subset is declared in HouseProtocol, while class House implements its methods.</p>
  
  <pre><code>@protocol HouseProtocol &lt;NSObject&gt;
  -(void) foo;
  @end
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@interface House : NSObject &lt;HouseProtocol&gt;
  -(void) foo;
  -(void) bar;
  @end
  </code></pre>
  
  <p>Somewhere else in another class, a method is defined taking a HouseProtocol argument:</p>
  
  <pre><code>-(void) somemethod:(id&lt;HouseProtocol&gt;)hp;
  </code></pre>
  
  <p>This method should use methods of house, but only those which are accessible in HouseProtocol. Meaning method foo but not method bar.</p>
  
  <p>Is the above correct, and how is the foo method called inside somemethod? Working code appreciated.</p>