I have a UIButton inside a UITableViewCell . When a user touches a cell button, I want to display a UIPopoverController button pointing to the button.
Currently, I have the following code in the cell delegate (the delegate is the view controller that owns the UITableView):
-(void) onStatusButtonTouched:(UIButton *)aButton{ StatusPickerController *statusPicker = [[StatusPickerController alloc] init]; _popOver = nil; _popOver = [[UIPopoverController alloc] initWithContentViewController:statusPicker]; [_popOver setDelegate:self]; [_popOver presentPopoverFromRect:aButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES]; [_popOver setPopoverContentSize:CGSizeMake(100, 352)]; }
With this code, a tooltip always points to the top of the view, since the position of the y button is relative to its cell.
My question is: how can I find out the absolute position of a button to point to it? Is there any way to solve it?
source share