title: Xcode: Does the delegating object HAVE to send a message to the delegate object?
body: <p>I'm trying to assign SecondViewController as a delegate object of FirstViewController (if I understand correctly). However FirstViewController doesn't send any messages to SecondViewController. </p>
  
  <p>Am I allowed to pretend as though SecondViewController did get a message from FirstViewController and respond to the FirstViewController? (Note: My SecondViewController is in charge of a view that has a button. When I press the button on my SecondViewController's view I want it to tell the FirstViewController to update its view)</p>
  
  <p>FirstViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @protocol FirstViewControllerDelegate &lt;NSObject&gt;
  @optional
  - (void) setAnotherLabel;
  @end
  
  @interface FirstViewController : UIViewController {
      IBOutlet UILabel *label;
      id &lt;FirstViewControllerDelegate&gt; delegate;
  }
  @property (nonatomic, retain) IBOutlet UILabel *label;
  @property (nonatomic, assign) id &lt;FirstViewControllerDelegate&gt; delegate;
  - (void) pretendLabel;
  - (void) realLabel;
  @end
  </code></pre>
  
  <p>FirstViewController.m</p>
  
  <pre><code>#import "FirstViewController.h"
  
  
  @implementation FirstViewController
  @synthesize label;
  @synthesize delegate;
  
  
  // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  - (void) setAnotherLabel;
  {
      label.text =@"Real";
      [self.view setNeedsDisplay];
  }
  
  - (void) pretendLabel;
  {
      label.text =@"Pretend";
      [self.view setNeedsDisplay];
  }
  
  - (void) realLabel;
  {
      [self setAnotherLabel];
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      label.text=@"Load";
      [self pretendLabel];
  }
  ...
  @end
  </code></pre>
  
  <p>SecondViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;Foundation/Foundation.h&gt;
  #import "FirstViewController.h"
  
  @interface SecondViewController : UIViewController &lt;UIImagePickerControllerDelegate, UINavigationControllerDelegate, FirstViewControllerDelegate&gt;
  {
      UIImage *image;
      IBOutlet UIImageView *imageView;
  }
  
  - (IBAction) sendPressed:(UIButton *)sender;
  - (IBAction) cancelPressed:(UIButton *)sender;
  @end
  </code></pre>
  
  <p>SecondViewController.m</p>
  
  <pre><code>#import "SecondViewController.h"
  
  @implementation SecondViewController
  
  - (IBAction) sendPressed:(UIButton *)sender
  {
      FirstViewController *fvc = [[FirstViewController alloc] init];
      [fvc setDelegate:self];
      //how do I find out if I'm actually the delegate for FirstViewController at this point?
      [fvc realLabel];
      self.tabBarController.selectedIndex = 0;//switch over to the first view to see if it worked
  }
  </code></pre>