title: UIPopoverController Delegate Problem?
body: <p>I have a UIPopover that I want to use either</p>
  
  <pre><code>-(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{
      return NO;
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-(void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController{}
  </code></pre>
  
  <p>on. Neither of them seem to work (and I'm sure once one is fixed, the other will be too since it's probably a problem with delegates). For delegates, here is what I have:</p>
  
  <p>In optionsViewController.h, the view which is inside the popover:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @protocol OptionsViewControllerDelegate &lt;NSObject&gt;
  
  
  -(void)didPick:(NSString *)string;
  @end
  id delegate;
  
  
  @interface OptionsViewController : UIViewController &lt;OptionsViewControllerDelegate&gt;{
  
      IBOutlet UIPickerView *picker;
      NSMutableArray *list;
  
  }
  @property (nonatomic, copy) NSArray *passthroughViews;
  @property(nonatomic,retain) NSMutableArray *list;
  @property(nonatomic,assign) id&lt;OptionsViewControllerDelegate&gt; delegate;
  
  @end
  </code></pre>
  
  <p>and in the .m:</p>
  
  <pre><code>@synthesize delegate;
  </code></pre>
  
  <p>and in the .h of the view where the popover appears:</p>
  
  <pre><code>@interface exampleViewController : UIViewController &lt;OptionsViewControllerDelegate,UIPopoverControllerDelegate&gt;{
      UIPopoverController *popoverController;
      OptionsViewController *optionsViewController;
  }
  </code></pre>
  
  <p>and in the .m:</p>
  
  <pre><code>@synthesize popoverController;
  @synthesize optionsViewController;
  -(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{
      return NO;
  }
  
      [popoverController release];
      [optionsViewController release];
  </code></pre>
  
  <p>In the ViewDidLoad, I have:</p>
  
  <pre><code>if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  
          optionsViewController =[[OptionsViewController alloc]init];
          optionsViewController.delegate = self;
          popoverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];
          popoverController.popoverContentSize = CGSizeMake(320, 216);
      }
  </code></pre>
  
  <p>To present the popover, I use:</p>
  
  <pre><code>-(IBAction)showDecadePopover{
      [popoverController presentPopoverFromRect:CGRectMake(150, 50, 150, 50) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
  }
  </code></pre>
  
  <p>I'm probably missing something really obvious (that's why I gave so much of my code). Thanks so much!</p>
  
  <p>Luke</p>