码迷,mamicode.com
首页 > 其他好文 > 详细

UIAlertView点击按钮不会销毁自身View

时间:2015-04-15 11:22:38      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:objective-c   uialertview   dismiss   

子类化UIAlertView,复写方法

- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;


/// UIAlertView subclass which can't be dismissed when buttons clicked.
@interface FixAlertView : UIAlertView

@end

@implementation FixAlertView

- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated {
    
//    [super dismissWithClickedButtonIndex:buttonIndex animated:animated];
    return;
}

@end

复写方法的时候,记得不要调用父类的方法。

参考自:http://stackoverflow.com/questions/2051402/is-it-possible-to-not-dismiss-a-uialertview/2051969#2051969

UIAlertView点击按钮不会销毁自身View

标签:objective-c   uialertview   dismiss   

原文地址:http://blog.csdn.net/tounaobun/article/details/45055719

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!