I have a split View controller, in which the left side holds a table view controller. How do I show an action sheet inside the popover when I click on the detail disclosure button of the table cell?
Try this :
UIActionSheet *popupSheet = [[UIActionSheet alloc] initWithTitle:@"Title"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"No Way !"
otherButtonTitles:nil];
popupSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
UIButton * disclosureButton = (UIButton *)cell.accessoryView;
[popupSheet showFromRect:disclosureButton.bounds inView:cell.accessoryView animated:YES];
[popupSheet release];
The UIActionSheet docs state that the showFromRect:inView:animated:
method:
displays the action sheet in a popover whose arrow points to the specified rectangle of the view (in our case the detail disclosure button). The popover does not overlap the specified rectangle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With