On Jun 14, 2013, at 1:06 PM, Gordon Apple wrote: > - (void)awakeFromNib { > [self.doc addObserver:self > forKeyPath:@"currentPath" > options:NSKeyValueObservingOptionNew | > NSKeyValueObservingOptionOld > context:nil]; > } > > - (void)observeValueForKeyPath:(NSString *)keyPath > ofObject:(id)object > change:(NSDictionary *)change > context:(void *)context { > > if (object == self.doc && [keyPath isEqualToString:@"currentPath"] && > self.outlineView != nil) { > [self.outlineView reloadData]; > > // Debugging > static NSUInteger dingCount = 0; > dingCount++; > NSLog(@"dingCount = %lu", dingCount); > } > } > > ³currentPath² property in doc gets set once. Observation gets dinged about > 200 times. Removing the ³reloadData² didn¹t affect this. Same observer in > another file gets dinged once, like it should. Stack trace always leads > back to where "currentPath" is set in doc. Any theories on what could cause > this observer to have diarrhea?
If it's not multiple calls to the setter, could it be multiple calls to awakeFromNib? What does the observationInfo on self.doc look like? _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com