Reputation: 1032
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.
Upvotes: 2
Views: 2850
Reputation: 17132
-(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];
}
}
Upvotes: 5