当前位置: 动力学知识库 > 问答 > 编程问答 >

osx - Bindings set hidden, if string value is larger than

问题描述:

I have a ButtonCell, which i want to hide using bindings, when the NSString value at keyPath

key1.key2

is larger than 3 character, but the binding offers me only

NSIsNotNil, NSIsNil,...

which doesnt apply in this case

网友答案:

Well In your XIB select you button then as attached in the screens shot follow the steps:-

  1. Now in your header and implementation file create property and synthesize variable of BOOL isEnable;
  2. And on the basis of your string count set it NO and YES.
网友答案:

you can use this method:

-(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context

in this one you can enable and disable cell according the value in key path

分享给朋友:
您可能感兴趣的文章:
随机阅读: