Pergunta

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];
 }
Foi útil?

Solução

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

Outras dicas

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

[proceedBtnOutlet setEnabled:YES];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top