无法在我的titleBar上启用UIButton

时间:2017-01-26 10:02:46

标签: objective-c uibutton

我需要在titleBar中启用一个按钮。而且这段代码没有启用它。知道为什么吗?

TitleBar.m
@property (weak, nonatomic) IBOutlet UIButton *homeButton;

-(void) shouldShowHomeButton:(BOOL)shouldShow
{
self.homeButton.enabled=shouldShow;
}

OtherViewController
{
TitleBarViewController *titleBarController = [[TitleBarViewController alloc]init];
[titleBarController shouldShowHomeButton:YES];
}

我在中设置了一个断点 - (void)shouldShowHomeButton:(BOOL)应该显示并且它在那里。但是没有更新按钮

1 个答案:

答案 0 :(得分:0)

以下是enabled的属性,希望这对您有帮助。

@property(nonatomic,getter=isEnabled) BOOL enabled;
// default is YES. if NO, ignores touch