I want to report to delegate each time I set a property.
The way I thought of doing it is to simply add the message to delegate during the setter of the property.
Now, the obvious way would be to simply write the common logic of setting a property and simply add the delegate call in the end – but this feels stupid.
I would prefer to be able to call some kind of [super setProperty] in the beginning, and only add my own logic at the end. (but super doesn’t make sense of course)
This way if I change the property type from ‘assign’ to ‘retain’ I wouldn’t need to change the setter code.
Any way of doing that? If not – any better suggestions over the obvious way?
Key value observation
Your ‘delegate’ object can register to receive notification when a property on your object changes. The synthesised setters are KVO compliant.