views:

162

answers:

1

Hi ! Need to override property setter of the parent class. In order to temporary block assignment. For example - selectedRange property of the UITextView. How can I do this ? Thanks.

+4  A: 
-(void)setFoo:(Foo *)newFoo {
  // Do something.
  [super setFoo: newFoo];
}

If you want to block the setter sometimes,

-(void)setFoo:(Foo *)newFoo {
  if (someCondition) {
    [super setFoo: newFoo];
  }
}
Frank Shearar
Note: doing this on Apple-provided APIs can, in some cases, cause your application to be denied from the store.
rpetrich