I have created an UIActionSheet using below code in our iPhone application:
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@"ActionSheetSample"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Button1",@"Button2",@"Button3", nil];
[actionSheet showInView:self.view];
Now, my action sheet created successfully but my problem is how can I identify which button is clicked.!
Please help me!
Tarun Kumar
09-Feb-2016UIActionSheet provides a delegate method actionSheet:clickedButtonAtIndex: when the user clicks a button on an action sheet.
For Example:
Above method have two parameters actionSheet and buttonIndex.
actionsheet: contains the action button, and
buttonIndex have the button indices which will start at 0.