I have a UIView subclass CustomView
that has a property CustomObject *model
, as well as a couple IBOutlet
properties. CustomObject
has two properties, an NSString *title
and NSString *imageName
. I would like an easy, extensible way to update CustomView
's various outlets whenever anything in model
changes. I feel like there should be some easy way to do this using KVO, but since a new object can be assigned to model
, I can't just subscribe to those notifications.
I can think of one way to do this (which I have used before) is to override - (void)setModel:(CustomObject *)model
to redo my layout and resubscribe to that object's keys for KVO. Is this the most reasonable solution, or am I overlooking something obvious?