Implement the delegate method
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
OR
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
if(buttonIndex == actionSheet.destructiveButtonIndex)
{
}
else if(buttonIndex == (actionSheet.cancelButtonIndex))
{
// Call your event here
// Fire the event of UIBarButtonItem.
}
}
actionSheet:didDismissWithButtonIndex:
Sent to the delegate after an action sheet is dismissed from the screen.
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex Parameters
actionSheet The action sheet that was dismissed. buttonIndex The index
of the button that was clicked. The button indices start at 0. If this
is the cancel button index, the action sheet is canceling. If -1, the
cancel button index is not set.
Discussion:
This method is invoked after the animation ends and the view is hidden.
actionSheet:willDismissWithButtonIndex:
Sent to the delegate before an action sheet is dismissed.
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex Parameters
actionSheet The action sheet that is about to be dismissed.
buttonIndex The index of the button that was clicked. If this is the
cancel button index, the action sheet is canceling. If -1, the cancel
button index is not set.
Discussion This method is invoked before the
animation begins and the view is hidden.
UIButton
over thisUIBarButtonItem
. On the click ofUIButton
, I load aUIActionSheet
. And on the click of the cancel button inUIActionSheet
, I need to fire the event ofUIBarButtonItem
. – CarittaUIBarButtonItem
if yourUIBarButtonItem
is under theUIButton
? – Advocacy