title: Send a Delegate message from UIPopover to Main UIViewController
body: <p>I'm trying to use a Button in my <code>UIPopover</code> to create a <code>UITextView</code> in my Main <code>UIViewController</code> the code I have looks something like this (<code>PopoverView.h</code> file): </p>
  
  <pre><code>@protocol PopoverDelegate &lt;NSObject&gt; 
  
  - (void)buttonAPressed;
  
  @end
  
  @interface PopoverView : UIViewController &lt;UITextViewDelegate&gt; {  //&lt;UITextViewDelegate&gt;
  
      id &lt;PopoverDelegate&gt; delegate;
      BOOL sendDelegateMessages;
  }
  @property (nonatomic, retain) id delegate;
  @property (nonatomic) BOOL sendDelegateMessages;
  @end
  </code></pre>
  
  <p>Then in my <code>PopoverView.m</code> file:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
  UIButton * addTB1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  addTB1.frame = CGRectMake(0, 0, 100, 50);
  [addTB1 setTitle:@"Textbox One" forState:UIControlStateNormal];
  [self.view addSubview:addTB1];    // Do any additional setup after loading the view from its nib.
  [addTB1 addTarget:self action:@selector(buttonAPressed) 
  forControlEvents:UIControlEventTouchUpInside];
  }
  
  - (void)buttonAPressed
  {
      NSLog(@"tapped button one");
  
      if (sendDelegateMessages)
          [delegate buttonAPressed];
  }
  </code></pre>
  
  <p>And also in my <code>MainViewController.m</code> :</p>
  
  <pre><code>- (void)buttonAPressed {
  
      NSLog(@"Button Pressed");
      UITextView *textfield = [[UITextView alloc] init];
      textfield.frame = CGRectMake(50, 30, 100, 100);
      textfield.backgroundColor = [UIColor blueColor];
      [self.view addSubview:textfield];
  }
  </code></pre>
  
  <p>I'm using a delegate protocol to link the popover and the ViewController but I'm stuck on how I get my <code>BOOL</code> statement to link the <code>-(void)buttonAPressed</code> in the PopoverView and  MainViewController so that when I press the button in the Popover a textview appears in the Main VC. How would I go about doing this?</p>