objective-c - objective-c UIAlertView队列

标签 objective-c ios

我想在iOS上一一显示多个消息,但是问题是显示UIAlertView是非阻塞的。我尝试使用clickedButtonAtIndex处理警报关闭并在内部显示相同的警报。这是一些代码:

@interface ViewController : UIViewController <UIAlertViewDelegate>
...
@property UIAlertView *alert;
...
@end

...
[alert show]; //somewhere in code, starts chain of messages
...

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    // Some changes in alert object
    [alert show];
}

最佳答案

我将拥有一个UIAlertView并在单击按钮时更改其消息...也许也可以增加其标签

尝试覆盖

-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex

代替clickedButtonAtIndex

关于objective-c - objective-c UIAlertView队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11596006/

相关文章:

ios - 具有自动调整单元格的 Collection View 不再水平滚动

iphone - CAEmitterLayer 动画无法在设备上运行

objective-c - 相同的算法在 Objective-C 中的运行速度比 Swift 快得多(经过优化)

ios - 如何在 Objective-C 中通过 IP 地址连接到设备

iphone - 用黑色矩形覆盖屏幕吗?

ios - 在新添加的 UIView 上接收 UITouchesMoved

objective-c - 在 objective-c 中从 uilabel 获取文本

c# - 继承/设置 RadioGroup 的 BackgroundView 生成的 DialogViewController TableView (MonoTouch.Dialog)

ios - 当用户终止应用程序时重新连接蓝牙设备

javascript - FlatList contentContainerStyle -> justifyContent : 'center' causes issues with scrolling