title: Calling ViewController's method from its view's subview?
body: <p>I'm working on a project after my ex-colleague. The code was great except for one,</p>
  
  <p><strong>Main Controller</strong></p>
  
  <pre><code>@interface MainController : UIViewController {
  
  }
  
  @property (nonatomic, strong) IBOutlet HeaderBar *headerBar;
  
  - (void)setup;
  - (IBAction)refreshHeader;
  
  @end
  
  
  @implementation MainController 
  
  - (void)setup{
      HeaderBar *hb = [[HeaderBar alloc] initWithNibNames:@"HeaderBar"];
      self.headerBar = hb;
  }
  
  - (IBAction)refreshHeader {
      //Do something with headerBar's properties
      //For example, [self.headerBar someiVar];
  }
  </code></pre>
  
  <p>Then, there is a button as a subview of HeaderBar view. This button was tied with <strong>FirstResponder's method</strong>, which appears to be <strong>refreshHeader</strong></p>
  
  <p>The code works fine as he wanted. But, even I'm new to iOS Development and I'm not quite understand about the FirstResponder yet. I don't feel right with this design approach.</p>
  
  <p>Since that button belongs to headerBar's view. It should tied to headerBar's method, right? 
  (assume that headerBar is a controller too)
  Then, find a way to send a data/result/message from headerBar to MainController instead of send it to MainController directly by using firstResponder.</p>
  
  <p>If that's so, how could I send data/result/message to one of MainController's method from a HeaderBar's method instead of using the approach which appearing in other part of the code. (Which I feel not good about it too, it looks weird. It looks like, create a relation between two controller, in a wrong way.)</p>
  
  <p><strong>Main Controller</strong></p>
  
  <pre><code>- (void)anotherSetup{
      FooterBar *fb = [[FooterBar alloc] initWithNibNames:@"FooterBar"];
      fb.mainController = self;
      self.footerBar = fb;
  }
  </code></pre>
  
  <p><strong>FooterBar</strong></p>
  
  <pre><code>#import "MainController.h"
  
  @interface FooterBar : UIViewController {
  
  }
  
  @property (nonatomic, strong) MainController *mainController;
  
  - (void)someMethod;
  
  @end
  
  @implementation FooterBar
  @synthesize mainController;
  
  - (void)someMethod {
      [self.mainController someMainControllerMethod];
  }
  </code></pre>
  
  <p>I read some other related questions, most of them said that the other approach is to define <strong>Protocal and Delegate</strong>, Is it the best way to do this? Is it the only way? Instead of two controller communicate with each other.</p>
  
  <p>Any suggestion is welcome, correct my misunderstanding is welcome too. I will have to work on this project for months and it's only at the second phase from five. So, I'd love to have least false design as possible.</p>
  
  <p>Best Regards</p>
  
  <p>P.S. I'm sorry if the code isn't correct, it isn't the actual code. Something may not correct, but, hope you guys can see the picture.</p>