views:

111

answers:

1

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?

+2  A: 

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.

Peter Hosey