Subclassing UIAlertView
Estoy intentando subclasificar UIAlertView para manejar mejor los estados de error en mi aplicación. El problema que estoy teniendo es con la otherButtonTitles parámetro terminado en cero, cuando creo mi subclase solo recoge la primera cadena de la lista en lugar de todas las cadenas
+ (ErrorAlertView *)displayErrorAlertViewWithTitle:(NSString *)title
message:(NSString *)message
delegate:(id<UIAlertViewDelegate>)delegate
errorDelegate:(id<ErrorAlertViewDelegate>)errorDelegate
cancelButtonTitle:(NSString *)cancelButtonTitle
displayNow:(BOOL)displayNow
tag:(NSUInteger)tag
otherButtonTitles:(NSString *)otherButtonTitles, ...;
{
ErrorAlertView *errorAlertView = [[ErrorAlertView alloc] initWithTitle:title
message:message
delegate:delegate
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:otherButtonTitles, nil];
errorAlertView.errorDelegate = errorDelegate;
errorAlertView.tag = tag;
if (displayNow) {
[errorAlertView show];
}
return [errorAlertView autorelease];
}
Si hago la siguiente llamada al método anterior:
[ErrorAlertView displayErrorAlertViewWithTitle:[self noInternetConnectionAlertViewTitle]
message:[self noInternetConnectionAlertViewMessage]
delegate:self
errorDelegate:errorDelegate
cancelButtonTitle:@"OK"
displayNow:YES
tag:ErrorAlertTagInternetConnectionError
@"Try again",@"Setting", nil];
El UIAlertView se muestra con solo el botón @ "Intentar de nuevo".