title: uiBarButtonItem frame in popover best alternative
body: <p>I have dragged+dropped a barButtonItem on Story board and have been using this popover code but </p>
  
  <pre><code>[popoverController presentPopoverFromRect:self.barButonItem.frame 
  inView:self.view
  permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];     
  </code></pre>
  
  <p>barButtonItem.frame does not work as no frame property is available .</p>
  
  <p>What is the best aleternative to get it working perfectly ?<br>
   Thanks in Advance. </p>
  
  <p>Currently I am using this code :  I am using this method :  </p>
  
  <pre><code>- (IBAction)buttonClicked:(UIBarButtonItem *)sender event:(UIEvent *)event
  {
      UIView *viewt = [[UIView alloc] init]; 
  
      for(UITouch* touch in [event allTouches] ) 
      {
        if( [touch phase] == UITouchPhaseEnded ) 
        { 
           viewt = [touch view]; 
        }
      }
  }
  </code></pre>
  
  <p><code>self.barButtonItem.frame</code> will become <code>viewt.frame</code> .  </p>
  
  <p>Its working for now . Is it correct ?</p>
  
  <pre><code>//create a popover controller with my DatePickerViewController in it
  
  
  UIViewController* popoverContent = [[UIViewController alloc] init]; //ViewController
  
  UIView *popoverView = [[UIView alloc] init];   //view
  popoverView.backgroundColor = [UIColor blackColor];
  
  datePicker=[[UIDatePicker alloc]init];//Date picker
  datePicker.frame=CGRectMake(0,44,320, 216);
  datePicker.datePickerMode = UIDatePickerModeDate;
  [datePicker setMinuteInterval:5];
  [datePicker setTag:10];
  [datePicker addTarget:self action:@selector(Result) forControlEvents:UIControlEventValueChanged];
  [popoverView addSubview:datePicker];
  
  popoverContent.view = popoverView;
  popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContent];
  popoverController.delegate=self;
  
  
  
  [popoverController setPopoverContentSize:CGSizeMake(320, 264) animated:NO];
  [popoverController presentPopoverFromRect:self.barButtonItem.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];    
  </code></pre>