Lets say I have a custom control called FooBox. It is just a square on the screen. It has some properties like color, border, etc. When I change the properties, I want the FooBox to redraw itself to reflect its new properties. Is there a way to do that without writing custom setters and putting [self setNeedsDisplay:YES] into all of them?
Share
Two other ways:
setNeedsDisplay:YESto it immediately after. Not always possible, and no less of a hassle.setValue:forKey:to add thesetNeedsDisplay:message to it, and use that to set the view’s properties. This will require boxing up any numeric or structure values, which is trading one hassle for another.So, effectively, no.