Я получаю это ниже исключение при быстром пользователеUIAlertView сбои
0 CoreFoundation __exceptionPreprocess + 130
1 libobjc.A.dylib objc_exception_throw + 38
2 CoreFoundation -[NSObject(NSObject) doesNotRecognizeSelector:] + 202
3 CoreFoundation ___forwarding___ + 706
4 CoreFoundation _CF_forwarding_prep_0 + 24
5 UIKit -[_UIModalItem setMessage:] + 40
6 UIKit -[_UIModalItem initWithTitle:message:otherButtonTitles:completion:delegate:] + 102
7 UIKit +[_UIModalItem modalItemWithType:title:message:buttonTitles:completion:] + 76
8 UIKit -[UIAlertView _modalItemForNeueCompatibility] + 362
9 UIKit -[UIAlertView popupAlertAnimated:animationType:atOffset:] + 56
10 UIKit -[UIAlertView popupAlertAnimated:animationType:] + 34
Я написал быстрый просмотр код в методе в одном из моей полезности класса
+(void)showAlertWithTitle:(NSString*)title message:(NSString*)msg cancelButtonTitle:(NSString*)canceltitle confirmBtnTitle:(NSString*)cnftitle andTag:(int)alertTag andDelegate:(id)ref{
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:title message:msg delegate:ref cancelButtonTitle:canceltitle otherButtonTitles:cnftitle, nil];
alertView.tag = alertTag;
[alertView show];
}
Я реализовал идентичный код, и он отлично работает. У вас есть точка останова, созданная для исключений цели-c? – Mike
Существует ли 'ref', когда предупреждение отклонено? – rebello95
На самом деле я передам 'ref', когда мне нужно выполнить какое-либо действие. В противном случае 'ref' будет' nil' не означает делегата. –