Question

Let's say I want to observe the hidden property on UIView:

@property(nonatomic, getter=isHidden) BOOL hidden

Do I add an observer for the keypath hidden or isHidden?

Was it helpful?

Solution

hidden.

Think about it from the other side: setting the property. The setter will be setHidden:, not setIsHidden:, and your property assignments will be self.hidden = flag, not self.isHidden = flag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top