删除确认

发布于 2024-10-12 03:08:09 字数 123 浏览 3 评论 0原文

我有一张 UIAction Sheet,有 4 个按钮,1 个是删除。 删除运行完美,但现在我想添加一些确认框,因此如果用户单击“是”按钮,记录将被删除,否则不会。 我不知道如何添加这个确认框以及在哪里?

先感谢您。

I have one UIAction Sheet and there are 4 buttons, 1 is delete.
delete is running perfectly but now i want to add some confirmation box, so if user click on "Yes" button the record will be delete else not.
I don't know how to add this confirmation box and where?

thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦在深巷 2024-10-19 03:08:09

@pooja我建议您在代码中使用UIAlertView,在删除按钮操作上使用UIActionSheet删除按钮调用此..

UIAlertView *updateAlert = [[UIAlertView alloc] initWithTitle: @"Item Deletion" message: @"Do u really want to delete" delegate: self cancelButtonTitle: @"YES"  otherButtonTitles:@"NO",nil];

    [updateAlert show];
    [updateAlert release];

}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex==0)
    {
    //give deletion code here   
    }

}

并且忘记调用UIActionSheetDelegate...
希望这对你有帮助!

@pooja i suggest u to use UIAlertView for that in your code where you are using UIActionSheet delete button on delete button action call this..

UIAlertView *updateAlert = [[UIAlertView alloc] initWithTitle: @"Item Deletion" message: @"Do u really want to delete" delegate: self cancelButtonTitle: @"YES"  otherButtonTitles:@"NO",nil];

    [updateAlert show];
    [updateAlert release];

}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex==0)
    {
    //give deletion code here   
    }

}

and do forgot to call UIActionSheetDelegate...
Hope this will help u!!!!

葬心 2024-10-19 03:08:09

为此,您需要放置一个警报视图。当按下索引 0,1 处的按钮时,执行所需的操作。当用户按下操作表的删除按钮时,您必须放置此警报视图。

干杯

You need to put an alert view for this purpose.When the button at index 0,1 is pressed perform the desired action.You will have to put this alert view when the user presses the delete button of the Action Sheet.

Cheers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文