I have a simple view with a button linked with "showAlert" method. When I click on this button, it displays a UIAlertView.
Before, with ios 6, I was using the following code to disable a UIAlertView button :
- (IBAction)showAlert:(id)sender
{
myAlert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"Retour" otherButtonTitles:@"Button1", @"Button2", @"Button3", @"Button4", nil];
[myAlert show];
for(UIView *aView in myAlert.subviews)
{
if ([[[aView class] description] isEqualToString:@"UIAlertButton"])
{
UIButton *aButton = (UIButton *)aView;
if ([aButton.titleLabel.text isEqualToString:@"Button2"])
aButton.enabled = NO;
}
}
}
Now, with ios 7, it does not work... Why ?