iphone - 以编程方式取消 UIAlertView

标签 iphone objective-c cocoa uialertview alert

如何以编程方式取消 UIAlertView? 这是我用来显示 UIAlertView 的代码

UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Save Background" message:@"Downloading..." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil];
    CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 70.0);
    [myAlertView setTransform:myTransform];
    [myAlertView show];

最佳答案

尝试像这样使用 dismissWithClickedButtonIndex::

这里是要使用的代码:

[myAlertView dismissWithClickedButtonIndex:-1 animated:YES];

关于iphone - 以编程方式取消 UIAlertView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11887709/

相关文章:

objective-c - 如何处理临时 NSManagedObject 实例?

ios - 我的位置和目的地之间没有路线

ios - 创建可重用的 iOS "views"(如何调整大小?)

cocoa - iSight 中的曝光锁定

objective-c - 在 Setter 中保留计数和复制?

arrays - cocoa 多维NSArray

iPhone 作为机器人 Controller

iphone - CSS/iPod 触摸 : Font becomes much bigger if I add another line of text

不同 uiview 中的 iOS 多点触控事件

ios - 检查NSDictionary数组是否包含NSDictionary