I have a tableview of items and when i click one row, I want to use uialertview with uiactionsheet with button: edit, remove and cancel. When I click button edit, I will open a modal view. Before, I did edit modal view already and when I click one row, I will go to edit modal view, but now I want to add uiactionsheet, so how can I do this ?
Write UIAlertview or UIActionsheet in -(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
method.
I think it will be helpful to you.
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"title" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"delete" otherButtonTitles:@"other 1", @"other 2", nil];
[actionSheet showInView:self.view];
//or
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"button",@"button1", nil];
[alert show];
}