子类化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
时间: 2024-11-19 07:10:11