2017-01-26 2 views
0

私のtitleBarのボタンを有効にする必要があります。そして、このコードはそれを有効にしません。どんな考え?私のtitleBarでUIButtonを有効にできません

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]; 
} 

私はにブレークポイントを置く - (無効)shouldShowHomeButton:(BOOL)shouldShow、それはそこで起こっています。ボタンは更新されません

+0

メソッド名 'ボタンの_visible_を作るのではなく、それを可能にされて何を言ってるのか示唆shouldShowHomeButton'。その場合、ボタンの 'hidden'プロパティをYESに設定する必要があります。 – davidf2281

+0

私はそれを有効にする必要があります、親切にメソッド名を無視してください – Supermannoying

答えて

0

ここにはenabledのプロパティがあり、これが役立つことを願っています。

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

関連する問題