gpt4 book ai didi

ios - 从 iOS7 中的应用程序中关闭所有 UIAlertview

转载 作者:行者123 更新时间:2023-11-29 10:50:07 24 4
gpt4 key购买 nike

<分区>

当我进入后台模式时,我想删除应用程序中的所有 UIAlertview。我正在使用以下代码来执行此操作。

for (UIWindow* w in [UIApplication sharedApplication].windows)
for (NSObject *o in w.subviews)
{
if ([o isKindOfClass:[UIAlertView class]])
{
[(UIAlertView *)o dismissWithClickedButtonIndex:[(UIAlertView *)o cancelButtonIndex] animated:YES];
}
}

它在 iOS6 中正常工作。当我在 iOS7 设备中运行相同的应用程序时,它无法正常工作。有什么想法吗?

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