On Thu, Oct 6, 2011 at 12:33 PM, Quincey Morris
<quinceymor...@rivergatesoftware.com> wrote:
> By all means use self-observation if that solves your problem. There's 
> absolutely nothing wrong with it, so any negative feelings you might have are 
> just another perceptual problem. Note, however, that because the observer 
> mechanism is so clunky, you're going to write *more* lines of code this way 
> than in overriding the setter, yet all it buys you is the 
> unwanted/unnecessary "atomic" implementation.

Not necessarily. If you expect subclasses to add properties that
require poking -setNeedsDisplay:, or you just have a lot of them, it's
probably worth adding a class method like +keyPathsRequiringRedisplay,
register as self-observers for all these keypaths, and provide a
really simple implementation of -observeValueForKeyPath:… that calls
[self setNeedsDisplay].

As far as "unwanted/unnecessary 'atomic'" is concerned, don't get me
started. That design mistake is going to haunt us forever.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to