title: How to create delegation from child to parent (subview-superview)
body: <p>i've worked with delegation before. i know how to create delegation from a superview to a subview class. however, i'm trying to do it the opposite way using the same approach but it's not working! is delegation meant only to work one way or is there a way/trick to use it as a two way communication between the classes? I'm receiving an error at the parent/superview .h class which is: </p>
  
  <blockquote>
    <p>Cannot find protocol definition for 'SubViewControllerDelegate'</p>
  </blockquote>
  
  <p>my code goes like this:
  subview.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  #import "SuperViewController.h"
  
  @protocol SubViewControllerDelegate &lt;NSObject&gt;
  
      - (void)someMethod:(NSData *)data;
  
  @end
  
  @interface SubViewController : UIViewController 
  
  @property (weak, nonatomic) id &lt;SubViewControllerDelegate&gt; delegate;
  
  @end
  </code></pre>
  
  <p>subview.m:</p>
  
  <pre><code>[self.delegate someMethod:data]; 
  </code></pre>
  
  <p>SuperView.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  #import "SubViewController.h"
  
  @interface SuperViewController : UIViewController &lt;SubViewControllerDelegate&gt;
  
  @end
  </code></pre>
  
  <p>SuperView.m:</p>
  
  <pre><code>#pragma mark - SubView Controller Delegate Methods
  - (void)someMethod:(NSData *)data{
      NSLog(@"%@", data);
  }
  </code></pre>
  
  <p>am i doing anything wrong or missing out anything?</p>