title: Declaring a delegate protocol
body: <p>I would like to know what is the difference when declaring a <code>protocol</code> in the same class and when declaring it in a separate file; example :</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @class MyClassA;
  
  @protocol MyDelegate &lt;NSObject&gt;
  
  @required
  - (MyClassA*)myMythod;
  
  @optional
  - (void)anOtherMethod:(NSString*)ID;
  
  @end
  
  @interface MyClassB : UIViewController &lt;UITableViewDataSource, UITableViewDelegate&gt;
  
  @property (nonatomic, assign) id &lt;MyDelegate&gt; delegate;
  ......
  </code></pre>
  
  <p>here I declare the protocol delagate in the same file with MyClassB, and I can declare it (the protocol delegate) in a separate source file. What is the difference between declaring it in the same file with the class and in a separate file? Thanks!</p>