realm/realm-cocoa — pull request #804 by dismory (2014-08-18 17:52:22+00:00)
Title: Copy `_notificationHandlers ` in case it is mutated while being enumerated

It is reasonable to remove an Realm notification token while the execution of an notification block:

```objective-c
__weak typeof(self) weakSelf = self;
self->_token = [self->_realm addNotificationBlock:^(NSString *notification, RLMRealm *realm) {
__strong typeof(weakSelf) strongSelf = weakSelf;
[realm removeNotification:weakSelf->_token];
}];
[realm transactionWithBlock:^{
// do something to update the realm
}];
```

However, this will cause a crash:

```
Collection was mutated while being enumerated.
```

So `_notificationHandlers` is copied in case it is mutated while being enumerated.