UIAlertAction处理程序在延迟后运行

Pet*_*ali 16 objective-c uialertview ios uialertcontroller uialertaction

我正在尝试将我的UIAlertViews更改为UIAlertControllers.我为它设置了这个动作:

UIAlertAction *undoStopAction = [UIAlertAction actionWithTitle:@"Undo Stop"
                                                        style:UIAlertActionStyleDefault
                                                       handler:^(UIAlertAction *action) {
                                                           [self undoStop];
                                                       }];
Run Code Online (Sandbox Code Playgroud)

但是,处理程序在操作被点击后大约一秒钟才会运行.有什么方法可以加快速度吗?

小智 3

对于警报视图来说,短暂的延迟是正常的(不过不到一秒)。如果这对您来说不方便,您可以以编程方式创建一个带有标签和按钮覆盖屏幕的视图,基本上是一个自定义的警报视图。