gpt4 book ai didi

iphone - 如何在检测到用户单击 UIAlertView 上的确定按钮后退出程序

转载 作者:行者123 更新时间:2023-11-28 19:20:16 25 4
gpt4 key购买 nike

在我的程序中,我有如下代码。 DETECTING 用户在 UIAlertView 上单击 OK 后如何退出程序?

谢谢

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YOur Message" message:@"Your description"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
[alert release];

最佳答案

要获得取消(您的“确定”)按钮,请实现此方法:

 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
exit(0);
}

关于iphone - 如何在检测到用户单击 UIAlertView 上的确定按钮后退出程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9514501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com