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];
 }
有帮助吗?

解决方案

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

其他提示

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

[proceedBtnOutlet setEnabled:YES];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top