Pregunta

I have a button, proceedBtn. I set it in the interface builder to disable. I have radio buttons that I want to be selected before proceedBtn to be enabled. How to I set proceedBtn to enabled in the onRadioBtn function.

-(IBAction)onRadioBtn:(RadioButton*)sender
{
    Singleton *single = [Singleton sharedInstance];
    _statusLabel.text = [NSString stringWithFormat:@"Selected: %@", sender.titleLabel.text];
    single.rb = sender.titleLabel.text;

    NSLog(@"%@", sender.titleLabel.text);
}

- (IBAction)proceedBtn:(UIButton *)sender
{
    Singleton *single = [Singleton sharedInstance];

    NSLog(@"%@", single.rb);
    if([single.rb  isEqualToString: @"Choose Friend(s)"])
        [self nameWallToFriends];
    else
        [self nameWallToChooseHome];
 }
¿Fue útil?

Solución

write a global IBOutlet(in .h interface file) for your button and enable or disable where ever required.

Otros consejos

Enable it programmatically by any of your desired method from the same class :

[proceedBtnOutlet setEnabled:YES];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top