When we put lots of images to NSOperationQueue then we want to check our queue is completed or not.After completion of queue you want to perform some tasks (like you want to load another page).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ if (object == self.queue && [keyPath isEqualToString:@"operations"]) { if ([self.queue.operations count] == 0) { } } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } } |