Since I was going through some lines of code, I came across this problem a couple of days ago,
- (void)dealloc {
...
[self.postOfficeService deregister:self];
...
}
If de-registering from the mail branch service is an asynchronous operation, even if it is not obvious from the interface, since there is no block or function passed to postOfficeService.
The internal implementation of the postOfficeService method -deregisteris something similar
dispatch_asynch(_serialQueue, ^{
[self.subcribers removeObject:formerSubscriber];
});
...
The container self.subscribersdoes its job perfectly and contains only weak links. That is it NSHashTable.
, dealloc, , postOfficeService , .,
[self.subscribers removeObject:formerSubscriber], , formerSubscriber NSZombieObject. .
, deregister - , dispatch_synch dispatch_asynch
, , dealloc.
, NSZombie, ARC, - - NSHashTable ( , )?