Skip to content

Commit

Permalink
Delay ANResourceDidUpdateNotifications
Browse files Browse the repository at this point in the history
They tend to fire at times when table views are in inconsistent states, which is kind of a problem.
  • Loading branch information
beccadax committed Oct 9, 2012
1 parent c01515d commit ef49a75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ANResource.m
Expand Up @@ -62,9 +62,11 @@ - (void)setRepresentation:(NSDictionary *)representation {

_representation = representation;
objc_removeAssociatedObjects(self);

[NSNotificationCenter.defaultCenter postNotificationName:ANResourceDidUpdateNotification object:self];

[self didChangeValueForKey:@"representation"];

NSNotification * note = [NSNotification notificationWithName:ANResourceDidUpdateNotification object:self];
[NSNotificationQueue.defaultQueue enqueueNotification:note postingStyle:NSPostASAP coalesceMask:NSNotificationCoalescingOnName|NSNotificationCoalescingOnSender forModes:nil];
}

+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
Expand Down

0 comments on commit ef49a75

Please sign in to comment.